mirror of
https://github.com/esphome/esphome.git
synced 2024-11-24 12:06:26 +01:00
Use local defintions of COLOR_ON / COLOR_OFF
This commit is contained in:
parent
cf559ead56
commit
046065b307
@ -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_;
|
||||
|
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user