- [NEW] Labels amb color configurable. Per defecte blanc, com sol ser en els propertygrids

This commit is contained in:
2024-06-11 14:20:13 +02:00
parent 5ddc41e87c
commit f96305b0a4
2 changed files with 7 additions and 5 deletions

View File

@@ -5,11 +5,11 @@
namespace ui namespace ui
{ {
void label(const char *label, const int x, const int y, const int w, const int h) void label(const char *label, const int x, const int y, const int w, const int h, const int color)
{ {
draw::color(WHITE); draw::color(color);
draw::fillrect(x, y, w, h); draw::fillrect(x, y, w, h);
draw::color(PAPER); draw::color(WHITE);
draw::rect(x, y, w, h); draw::rect(x, y, w, h);
draw::print(label, x+3, y+3, BLACK, 0); draw::print(label, x+3, y+3, BLACK, 0);
} }
@@ -116,7 +116,7 @@ namespace ui
draw::color(LIGHT+WHITE); draw::color(LIGHT+WHITE);
draw::fillrect(x, y, w, h); draw::fillrect(x, y, w, h);
draw::color(PAPER); draw::color(WHITE);
draw::rect(x, y, w, h); draw::rect(x, y, w, h);
draw::print(label, x+3, y+3, PAPER, 0); draw::print(label, x+3, y+3, PAPER, 0);

View File

@@ -1,8 +1,10 @@
#pragma once #pragma once
#include "colors.h"
namespace ui namespace ui
{ {
void label(const char *label, const int x, const int y, const int w, const int h); void label(const char *label, const int x, const int y, const int w, const int h, const int color=WHITE+LIGHT);
const int button(const char *label, const int x, const int y, const int w, const int h, const int c1, const int c2, const int c3); const int button(const char *label, const int x, const int y, const int w, const int h, const int c1, const int c2, const int c3);
const int check(const char *label, const int x, const int y, const int w, const int h, const bool checked); const int check(const char *label, const int x, const int y, const int w, const int h, const bool checked);
const int combo(const char *label, const int x, const int y, const int w, const int h); const int combo(const char *label, const int x, const int y, const int w, const int h);