diff --git a/Kconfig.projbuild b/Kconfig.projbuild index 7e989b9..a8da8a6 100644 --- a/Kconfig.projbuild +++ b/Kconfig.projbuild @@ -4,4 +4,8 @@ config ESPGUI_MENUDISPLAY_ROWS int "Number of rows for MenuDisplays" default 10 +config ESPGUI_MENUITEM_BACKGROUND_COLOR + hex "MenuItem background color" + default 0x5AEB + endmenu diff --git a/src/menudisplay.cpp b/src/menudisplay.cpp index 72f7f00..e98b0d1 100644 --- a/src/menudisplay.cpp +++ b/src/menudisplay.cpp @@ -156,7 +156,7 @@ void MenuDisplay::redraw(TftInterface &tft) if (relativeIndex != m_highlightedIndex) { - drawItemRect(*labelsIter, TFT_GREY); + drawItemRect(*labelsIter, CONFIG_ESPGUI_MENUITEM_BACKGROUND_COLOR); *iconsIter = nullptr; labelsIter->start(tft); @@ -173,20 +173,20 @@ void MenuDisplay::redraw(TftInterface &tft) labelsIter->start(tft); } - labelsIter->redraw(tft, item.text(), item.color(), selected ? TFT_GREY : TFT_BLACK, item.font()); + labelsIter->redraw(tft, item.text(), item.color(), selected ? CONFIG_ESPGUI_MENUITEM_BACKGROUND_COLOR : TFT_BLACK, item.font()); if (const auto icon = item.icon(selected); icon != *iconsIter) { if (icon) tft.pushImage(6, labelsIter->y() + 1, *icon); else if (*iconsIter) - tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? TFT_GREY : TFT_BLACK); + tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? CONFIG_ESPGUI_MENUITEM_BACKGROUND_COLOR : TFT_BLACK); *iconsIter = icon; } // if (selected && (relativeIndex != m_highlightedIndex)) // { -// drawItemRect(*labelsIter, TFT_GREY); +// drawItemRect(*labelsIter, CONFIG_ESPGUI_MENUITEM_BACKGROUND_COLOR); // } labelsIter++;