mirror of
https://github.com/esphome/esphome.git
synced 2024-11-10 01:07:45 +01:00
graphical_display_menu
requires a Display, not DisplayBuffer (#6614)
This commit is contained in:
parent
06829b53fe
commit
8027921ba3
3 changed files with 4 additions and 2 deletions
|
@ -38,7 +38,7 @@ CONFIG_SCHEMA = DISPLAY_MENU_BASE_SCHEMA.extend(
|
|||
cv.Schema(
|
||||
{
|
||||
cv.GenerateID(): cv.declare_id(GraphicalDisplayMenu),
|
||||
cv.Optional(CONF_DISPLAY): cv.use_id(display.DisplayBuffer),
|
||||
cv.Optional(CONF_DISPLAY): cv.use_id(display.Display),
|
||||
cv.Required(CONF_FONT): cv.use_id(font.Font),
|
||||
cv.Optional(CONF_MENU_ITEM_VALUE): cv.templatable(cv.string),
|
||||
cv.Optional(CONF_FOREGROUND_COLOR): cv.use_id(color.ColorStruct),
|
||||
|
|
|
@ -229,7 +229,8 @@ inline void GraphicalDisplayMenu::draw_item(display::Display *display, const dis
|
|||
label.append(this->menu_item_value_.value(&args));
|
||||
}
|
||||
|
||||
display->print(bounds->x, bounds->y, this->font_, foreground_color, display::TextAlign::TOP_LEFT, label.c_str());
|
||||
display->print(bounds->x, bounds->y, this->font_, foreground_color, display::TextAlign::TOP_LEFT, label.c_str(),
|
||||
~foreground_color);
|
||||
}
|
||||
|
||||
void GraphicalDisplayMenu::draw_item(const display_menu_base::MenuItem *item, const uint8_t row, const bool selected) {
|
||||
|
|
|
@ -62,6 +62,7 @@ struct Color {
|
|||
return Color(esp_scale8(this->red, scale), esp_scale8(this->green, scale), esp_scale8(this->blue, scale),
|
||||
esp_scale8(this->white, scale));
|
||||
}
|
||||
inline Color operator~() const ALWAYS_INLINE { return Color(255 - this->red, 255 - this->green, 255 - this->blue); }
|
||||
inline Color &operator*=(uint8_t scale) ALWAYS_INLINE {
|
||||
this->red = esp_scale8(this->red, scale);
|
||||
this->green = esp_scale8(this->green, scale);
|
||||
|
|
Loading…
Reference in a new issue