diff --git a/esphome/components/graphical_layout/text_panel.cpp b/esphome/components/graphical_layout/text_panel.cpp index f0a5b9e96c..8273a9e018 100644 --- a/esphome/components/graphical_layout/text_panel.cpp +++ b/esphome/components/graphical_layout/text_panel.cpp @@ -14,6 +14,7 @@ static const int TEXT_ALIGN_Y_MASK = void TextPanel::dump_config(int indent_depth, int additional_level_depth) { std::string text = this->text_.value(); + ESP_LOGCONFIG(TAG, "%*sText Align: %s", indent_depth, "", display::text_align_to_string(this->text_align_)); ESP_LOGCONFIG(TAG, "%*sText: %s", indent_depth, "", text.c_str()); } diff --git a/esphome/components/graphical_layout/text_panel.h b/esphome/components/graphical_layout/text_panel.h index bd497e2da9..b72712cce5 100644 --- a/esphome/components/graphical_layout/text_panel.h +++ b/esphome/components/graphical_layout/text_panel.h @@ -7,10 +7,13 @@ #include "esphome/core/automation.h" namespace esphome { -namespace graphical_layout { +namespace display { -const Color COLOR_ON(255, 255, 255, 255); -const Color COLOR_OFF(0, 0, 0, 0); +extern const Color COLOR_ON; +extern const Color COLOR_OFF; + +} // namespace display +namespace graphical_layout { /** The TextPanel is a UI item that renders a single line of text to a display */ class TextPanel : public LayoutItem { @@ -29,8 +32,8 @@ class TextPanel : public LayoutItem { TemplatableValue text_{}; display::BaseFont *font_{nullptr}; display::TextAlign text_align_{display::TextAlign::TOP_LEFT}; - Color foreground_color_{COLOR_ON}; - Color background_color_{COLOR_OFF}; + Color foreground_color_{display::COLOR_ON}; + Color background_color_{display::COLOR_OFF}; }; } // namespace graphical_layout