Use local defintions of COLOR_ON / COLOR_OFF

This commit is contained in:
Michael Davidson 2023-12-31 12:41:37 +11:00
parent cf559ead56
commit 046065b307
No known key found for this signature in database
GPG Key ID: B8D1A99712B8B0EB
3 changed files with 9 additions and 3 deletions

View File

@ -8,6 +8,9 @@ namespace graphical_layout {
static const char *const TAG = "layoutitem";
const Color COLOR_OFF(0, 0, 0, 0);
const Color COLOR_ON(255, 255, 255, 255);
display::Rect LayoutItem::measure_item(display::Display *display) {
display::Rect inner_size = this->measure_item_internal(display);
int margin_border_padding = this->margin_ + this->border_ + this->padding_;

View File

@ -11,6 +11,9 @@ class Rect;
namespace graphical_layout {
extern const Color COLOR_ON;
extern const Color COLOR_OFF;
/* HorizontalChildAlign is used to control alignment of children horizontally */
enum class HorizontalChildAlign {
/* Aligns all children to the left of their available width */
@ -105,7 +108,7 @@ class LayoutItem {
int margin_{0};
int padding_{0};
int border_{0};
Color border_color_{Color::BLACK};
Color border_color_{COLOR_ON};
};
const LogString *horizontal_child_align_to_string(HorizontalChildAlign align);

View File

@ -26,8 +26,8 @@ class TextPanel : public LayoutItem {
TemplatableValue<std::string> text_{};
display::BaseFont *font_{nullptr};
display::TextAlign text_align_{display::TextAlign::TOP_LEFT};
Color foreground_color_{display::COLOR_ON};
Color background_color_{display::COLOR_OFF};
Color foreground_color_{COLOR_ON};
Color background_color_{COLOR_OFF};
};
} // namespace graphical_layout