diff --git a/radio/src/thirdparty/libopenui/src/button.cpp b/radio/src/thirdparty/libopenui/src/button.cpp index e9f1f71fc..f2b9ad0e2 100644 --- a/radio/src/thirdparty/libopenui/src/button.cpp +++ b/radio/src/thirdparty/libopenui/src/button.cpp @@ -70,20 +70,20 @@ void Button::checkEvents() void TextButton::paint(BitmapBuffer * dc) { - auto textColor = DEFAULT_COLOR; - auto bgColor = FIELD_FRAME_COLOR; + auto textColor = COLOR_THEME_SECONDARY1; + auto bgColor = COLOR_THEME_SECONDARY2; if (bgColorHandler) { bgColor = bgColorHandler(); } else if (checked()) { - bgColor = HIGHLIGHT_COLOR; + bgColor = COLOR_THEME_ACTIVE; } else if (hasFocus()) { - bgColor = FOCUS_BGCOLOR; + bgColor = COLOR_THEME_FOCUS; } if (checked()) { if (hasFocus()) { - dc->drawSolidRect(0, 0, rect.w, rect.h, 2, FOCUS_BGCOLOR); + dc->drawSolidRect(0, 0, rect.w, rect.h, 2, COLOR_THEME_FOCUS); dc->drawSolidFilledRect(3, 3, rect.w - 6, rect.h - 6, bgColor); } else { dc->drawSolidFilledRect(0, 0, rect.w, rect.h, bgColor); @@ -93,13 +93,13 @@ void TextButton::paint(BitmapBuffer * dc) dc->drawSolidFilledRect(0, 0, rect.w, rect.h, bgColor); if (windowFlags & BUTTON_BACKGROUND) { if (hasFocus()) { - textColor = FOCUS_COLOR; + textColor = COLOR_THEME_PRIMARY2; } } else if (hasFocus()) { - dc->drawSolidRect(0, 0, rect.w, rect.h, 2, FOCUS_BGCOLOR); + dc->drawSolidRect(0, 0, rect.w, rect.h, 2, COLOR_THEME_FOCUS); } else { - dc->drawSolidRect(0, 0, rect.w, rect.h, 1, FIELD_FRAME_COLOR); + dc->drawSolidRect(0, 0, rect.w, rect.h, 1, COLOR_THEME_SECONDARY2); } } diff --git a/radio/src/thirdparty/libopenui/src/coloredit.cpp b/radio/src/thirdparty/libopenui/src/coloredit.cpp index b78ba7343..35b7d6c0e 100644 --- a/radio/src/thirdparty/libopenui/src/coloredit.cpp +++ b/radio/src/thirdparty/libopenui/src/coloredit.cpp @@ -41,7 +41,7 @@ class ColorBox: public Window { void paint(BitmapBuffer * dc) override { - dc->drawSolidFilledRect(0, 0, width(), height(), DEFAULT_COLOR); + dc->drawSolidFilledRect(0, 0, width(), height(), COLOR_THEME_SECONDARY1); dc->drawSolidFilledRect(1, 1, width() - 2, height() - 2, color << 16); } diff --git a/radio/src/thirdparty/libopenui/src/form.cpp b/radio/src/thirdparty/libopenui/src/form.cpp index 4e49eaced..a168f009f 100644 --- a/radio/src/thirdparty/libopenui/src/form.cpp +++ b/radio/src/thirdparty/libopenui/src/form.cpp @@ -87,17 +87,17 @@ void FormField::setFocus(uint8_t flag, Window * from) void FormField::paint(BitmapBuffer * dc) { if (editMode) { - dc->drawSolidFilledRect(0, 0, rect.w, rect.h, EDIT_MARKER_COLOR); + dc->drawSolidFilledRect(0, 0, rect.w, rect.h, COLOR_THEME_EDIT); } else { if (!(windowFlags & FORM_NO_BORDER)) { if (hasFocus()) { - dc->drawSolidFilledRect(0, 0, rect.w, rect.h, FOCUS_BGCOLOR); + dc->drawSolidFilledRect(0, 0, rect.w, rect.h, COLOR_THEME_FOCUS); } else if (!(windowFlags & FORM_BORDER_FOCUS_ONLY)) { - dc->drawSolidFilledRect(0, 0, rect.w, rect.h, FIELD_BGCOLOR); - dc->drawSolidRect(0, 0, rect.w, rect.h, 1, FIELD_FRAME_COLOR); + dc->drawSolidFilledRect(0, 0, rect.w, rect.h, COLOR_THEME_PRIMARY2); + dc->drawSolidRect(0, 0, rect.w, rect.h, 1, COLOR_THEME_SECONDARY2); } } } @@ -271,10 +271,10 @@ void FormGroup::paint(BitmapBuffer * dc) { if (!(windowFlags & (FORM_NO_BORDER | FORM_FORWARD_FOCUS))) { if (!editMode && hasFocus()) { - dc->drawSolidRect(0, 0, rect.w, rect.h, 2, FOCUS_BGCOLOR); + dc->drawSolidRect(0, 0, rect.w, rect.h, 2, COLOR_THEME_FOCUS); } else if (!(windowFlags & FORM_BORDER_FOCUS_ONLY)) { - dc->drawSolidRect(0, 0, rect.w, rect.h, 1, FIELD_FRAME_COLOR); + dc->drawSolidRect(0, 0, rect.w, rect.h, 1, COLOR_THEME_SECONDARY2); } } } diff --git a/radio/src/thirdparty/libopenui/src/keyboard_text.cpp b/radio/src/thirdparty/libopenui/src/keyboard_text.cpp index 717afde31..cbf3860a5 100644 --- a/radio/src/thirdparty/libopenui/src/keyboard_text.cpp +++ b/radio/src/thirdparty/libopenui/src/keyboard_text.cpp @@ -112,17 +112,17 @@ void TextKeyboard::paint(BitmapBuffer * dc) } else if (*c == KEYBOARD_SPACE[0]) { // spacebar - dc->drawBitmapPattern(x, y, LBM_KEY_SPACEBAR, DEFAULT_COLOR); + dc->drawBitmapPattern(x, y, LBM_KEY_SPACEBAR, COLOR_THEME_SECONDARY1); x += 135; } else if (*c == KEYBOARD_ENTER[0]) { // enter - dc->drawSolidFilledRect(x, y-2, 80, 25, TEXT_DISABLE_COLOR); + dc->drawSolidFilledRect(x, y-2, 80, 25, COLOR_THEME_DISABLED); dc->drawText(x+40, y, "ENTER", CENTERED); x += 80; } else if (int8_t(*c) < 0) { - dc->drawBitmapPattern(x, y, LBM_SPECIAL_KEYS[uint8_t(*c - 128)], DEFAULT_COLOR); + dc->drawBitmapPattern(x, y, LBM_SPECIAL_KEYS[uint8_t(*c - 128)], COLOR_THEME_SECONDARY1); x += 45; } else { diff --git a/radio/src/thirdparty/libopenui/src/libopenui_depends.h b/radio/src/thirdparty/libopenui/src/libopenui_depends.h index aa71e0fe6..4a9c2800d 100644 --- a/radio/src/thirdparty/libopenui/src/libopenui_depends.h +++ b/radio/src/thirdparty/libopenui/src/libopenui_depends.h @@ -36,21 +36,21 @@ event_t getWindowEvent(); // These colors MUST be defined // -// #define DEFAULT_COLOR -// #define DEFAULT_BGCOLOR -// #define FOCUS_COLOR -// #define FOCUS_BGCOLOR -// #define DISABLE_COLOR -// #define HIGHLIGHT_COLOR -// #define CHECKBOX_COLOR -// #define SCROLLBAR_COLOR -// #define MENU_COLOR -// #define MENU_BGCOLOR -// #define MENU_TITLE_BGCOLOR -// #define MENU_LINE_COLOR -// #define MENU_HIGHLIGHT_COLOR -// #define MENU_HIGHLIGHT_BGCOLOR -// #define OVERLAY_COLOR -// #define TABLE_BGCOLOR -// #define TABLE_HEADER_BGCOLOR +// #define COLOR_THEME_SECONDARY1 +// #define COLOR_THEME_SECONDARY3 +// #define COLOR_THEME_PRIMARY2 +// #define COLOR_THEME_FOCUS +// #define COLOR_THEME_DISABLED +// #define COLOR_THEME_ACTIVE +// #define COLOR_THEME_FOCUS +// #define COLOR_THEME_PRIMARY3 +// #define COLOR_THEME_SECONDARY1 +// #define COLOR_THEME_PRIMARY2 +// #define COLOR_THEME_SECONDARY1_THEME_SECONDARY1 +// #define COLOR_THEME_SECONDARY2 +// #define COLOR_THEME_PRIMARY2 +// #define COLOR_THEME_FOCUS +// #define COLOR_THEME_PRIMARY1 +// #define COLOR_THEME_SECONDARY3 +// #define COLOR_THEME_FOCUS // #define CUSTOM_COLOR diff --git a/radio/src/thirdparty/libopenui/src/menu.cpp b/radio/src/thirdparty/libopenui/src/menu.cpp index de1beffd7..258b13487 100644 --- a/radio/src/thirdparty/libopenui/src/menu.cpp +++ b/radio/src/thirdparty/libopenui/src/menu.cpp @@ -104,16 +104,16 @@ bool MenuBody::onTouchEnd(coord_t /*x*/, coord_t y) void MenuBody::paint(BitmapBuffer * dc) { - dc->clear(MENU_BGCOLOR); + dc->clear(COLOR_THEME_PRIMARY2); for (unsigned i = 0; i < lines.size(); i++) { auto& line = lines[i]; - LcdFlags flags = MENU_COLOR | MENU_FONT; + LcdFlags flags = COLOR_THEME_SECONDARY1 | MENU_FONT; if (selectedIndex == (int)i) { - flags = MENU_HIGHLIGHT_COLOR | MENU_FONT; - if (MENU_HIGHLIGHT_BGCOLOR != MENU_BGCOLOR) { + flags = COLOR_THEME_PRIMARY2 | MENU_FONT; + if (COLOR_THEME_FOCUS != COLOR_THEME_PRIMARY2) { dc->drawSolidFilledRect(0, i * MENUS_LINE_HEIGHT, width(), - MENUS_LINE_HEIGHT, MENU_HIGHLIGHT_BGCOLOR); + MENUS_LINE_HEIGHT, COLOR_THEME_FOCUS); } } if (line.drawLine) { @@ -135,7 +135,7 @@ void MenuBody::paint(BitmapBuffer * dc) if (i > 0) { dc->drawSolidHorizontalLine(0, i * MENUS_LINE_HEIGHT, MENUS_WIDTH, - MENU_LINE_COLOR); + COLOR_THEME_SECONDARY2); } } } @@ -151,7 +151,7 @@ MenuWindowContent::MenuWindowContent(Menu* parent) : void MenuWindowContent::paint(BitmapBuffer * dc) { // the background - dc->clear(MENU_BGCOLOR); + dc->clear(COLOR_THEME_PRIMARY2); // the title if (!title.empty()) { @@ -159,7 +159,7 @@ void MenuWindowContent::paint(BitmapBuffer * dc) (POPUP_HEADER_HEIGHT - getFontHeight(MENU_HEADER_FONT)) / 2, title.c_str(), CENTERED | MENU_HEADER_FONT); dc->drawSolidHorizontalLine(0, POPUP_HEADER_HEIGHT - 1, MENUS_WIDTH, - MENU_LINE_COLOR); + COLOR_THEME_SECONDARY2); } } @@ -234,5 +234,5 @@ void Menu::paint(BitmapBuffer * dc) r.x = toolbar->left(); r.w += toolbar->width(); } - dc->drawSolidRect(r.x - 1, r.y - 1, r.w + 2, r.h + 2, 1, MENU_LINE_COLOR); + dc->drawSolidRect(r.x - 1, r.y - 1, r.w + 2, r.h + 2, 1, COLOR_THEME_SECONDARY2); } diff --git a/radio/src/thirdparty/libopenui/src/menutoolbar.cpp b/radio/src/thirdparty/libopenui/src/menutoolbar.cpp index 7a27ae2d0..334098d52 100644 --- a/radio/src/thirdparty/libopenui/src/menutoolbar.cpp +++ b/radio/src/thirdparty/libopenui/src/menutoolbar.cpp @@ -27,11 +27,11 @@ void MenuToolbarButton::paint(BitmapBuffer * dc) MENUS_TOOLBAR_BUTTON_PADDING, MENUS_TOOLBAR_BUTTON_PADDING, MENUS_TOOLBAR_BUTTON_WIDTH - 2 * MENUS_TOOLBAR_BUTTON_PADDING, MENUS_TOOLBAR_BUTTON_WIDTH - 2 * MENUS_TOOLBAR_BUTTON_PADDING, - FOCUS_BGCOLOR); + COLOR_THEME_FOCUS); dc->drawSizedText(rect.w / 2, (rect.h - getFontHeight(FONT(STD))) / 2 + 1, - &picto, 1, CENTERED | FOCUS_COLOR); + &picto, 1, CENTERED | COLOR_THEME_PRIMARY2); } else { dc->drawSizedText(rect.w / 2, (rect.h - getFontHeight(FONT(STD))) / 2 + 1, - &picto, 1, CENTERED | DEFAULT_COLOR); + &picto, 1, CENTERED | COLOR_THEME_SECONDARY1); } } diff --git a/radio/src/thirdparty/libopenui/src/menutoolbar.h b/radio/src/thirdparty/libopenui/src/menutoolbar.h index de493a04f..484b6ba48 100644 --- a/radio/src/thirdparty/libopenui/src/menutoolbar.h +++ b/radio/src/thirdparty/libopenui/src/menutoolbar.h @@ -78,7 +78,7 @@ class MenuToolbar: public FormGroup { void paint(BitmapBuffer * dc) override { - dc->clear(DEFAULT_BGCOLOR); + dc->clear(COLOR_THEME_SECONDARY3); } #if defined(HARDWARE_KEYS) diff --git a/radio/src/thirdparty/libopenui/src/modal_window.cpp b/radio/src/thirdparty/libopenui/src/modal_window.cpp index e1557a17b..2c1222890 100644 --- a/radio/src/thirdparty/libopenui/src/modal_window.cpp +++ b/radio/src/thirdparty/libopenui/src/modal_window.cpp @@ -41,12 +41,12 @@ void ModalWindow::deleteLater(bool detach, bool trash) void ModalWindow::paint(BitmapBuffer * dc) { - dc->drawFilledRect(0, 0, width(), height(), SOLID, OVERLAY_COLOR, OPACITY(5)); + dc->drawFilledRect(0, 0, width(), height(), SOLID, COLOR_THEME_PRIMARY1, OPACITY(5)); } void ModalWindowContent::paint(BitmapBuffer * dc) { - dc->drawSolidFilledRect(0, 0, width(), POPUP_HEADER_HEIGHT, FOCUS_BGCOLOR); - dc->drawText(FIELD_PADDING_LEFT, (POPUP_HEADER_HEIGHT - getFontHeight(FONT(STD))) / 2, title.c_str(), FOCUS_COLOR); - dc->drawSolidFilledRect(0, POPUP_HEADER_HEIGHT, width(), height() - POPUP_HEADER_HEIGHT, DEFAULT_BGCOLOR); + dc->drawSolidFilledRect(0, 0, width(), POPUP_HEADER_HEIGHT, COLOR_THEME_FOCUS); + dc->drawText(FIELD_PADDING_LEFT, (POPUP_HEADER_HEIGHT - getFontHeight(FONT(STD))) / 2, title.c_str(), COLOR_THEME_PRIMARY2); + dc->drawSolidFilledRect(0, POPUP_HEADER_HEIGHT, width(), height() - POPUP_HEADER_HEIGHT, COLOR_THEME_SECONDARY3); } diff --git a/radio/src/thirdparty/libopenui/src/numberedit.cpp b/radio/src/thirdparty/libopenui/src/numberedit.cpp index 248cdbb74..facfdfb06 100644 --- a/radio/src/thirdparty/libopenui/src/numberedit.cpp +++ b/radio/src/thirdparty/libopenui/src/numberedit.cpp @@ -36,13 +36,13 @@ void NumberEdit::paint(BitmapBuffer * dc) LcdFlags textColor; if (editMode) - textColor = FOCUS_COLOR; + textColor = COLOR_THEME_PRIMARY2; else if (hasFocus()) - textColor = FOCUS_COLOR; + textColor = COLOR_THEME_PRIMARY2; // else if (enabled && (value != 0 || zeroText.empty())) - // textColor = DEFAULT_COLOR; + // textColor = COLOR_THEME_SECONDARY1; else - textColor = DEFAULT_COLOR; + textColor = COLOR_THEME_SECONDARY1; if (displayFunction) { displayFunction(dc, textColor, value); diff --git a/radio/src/thirdparty/libopenui/src/roller.h b/radio/src/thirdparty/libopenui/src/roller.h index d3a5ac846..7135e509a 100644 --- a/radio/src/thirdparty/libopenui/src/roller.h +++ b/radio/src/thirdparty/libopenui/src/roller.h @@ -81,9 +81,9 @@ class Roller: public Choice while (y < yMax) { auto displayedValue = getValueFromIndex(index); - auto fgColor = DISABLE_COLOR; + auto fgColor = COLOR_THEME_DISABLED; if (value == displayedValue) { - fgColor = FOCUS_COLOR | FONT(STD); + fgColor = COLOR_THEME_PRIMARY2 | FONT(STD); } unsigned valueIndex = displayedValue - vmin; @@ -95,7 +95,7 @@ class Roller: public Choice } if (windowFlags & ROLLER_SEPARATION_LINES) { - dc->drawSolidHorizontalLine(0, y - 10, width(), DISABLE_COLOR); + dc->drawSolidHorizontalLine(0, y - 10, width(), COLOR_THEME_DISABLED); } if (++index == valuesCount) diff --git a/radio/src/thirdparty/libopenui/src/static.h b/radio/src/thirdparty/libopenui/src/static.h index 15f1bcf5b..bceae5ba9 100644 --- a/radio/src/thirdparty/libopenui/src/static.h +++ b/radio/src/thirdparty/libopenui/src/static.h @@ -30,7 +30,7 @@ class StaticText: public Window text(std::move(text)) { if (windowFlags & BUTTON_BACKGROUND) { - setBackgroundColor(FIELD_FRAME_COLOR); + setBackgroundColor(COLOR_THEME_SECONDARY2); } } diff --git a/radio/src/thirdparty/libopenui/src/table.cpp b/radio/src/thirdparty/libopenui/src/table.cpp index 7ea4fd9a5..a4401d838 100644 --- a/radio/src/thirdparty/libopenui/src/table.cpp +++ b/radio/src/thirdparty/libopenui/src/table.cpp @@ -24,7 +24,7 @@ void Table::Header::paint(BitmapBuffer * dc) { coord_t x = 10; if (!cells.empty()) { - dc->clear(TABLE_HEADER_BGCOLOR); + dc->clear(COLOR_THEME_FOCUS); for (unsigned i = 0; i < cells.size(); i++) { auto cell = cells[i]; if (cell) { @@ -61,15 +61,15 @@ void Table::Body::paint(BitmapBuffer * dc) { coord_t y = 0; int index = 0; - dc->clear(DEFAULT_BGCOLOR); + dc->clear(COLOR_THEME_SECONDARY3); for (auto line: lines) { bool highlight = (index == selection); - dc->drawSolidFilledRect(0, y, width(), TABLE_LINE_HEIGHT - 2, highlight ? MENU_HIGHLIGHT_BGCOLOR : TABLE_BGCOLOR); + dc->drawSolidFilledRect(0, y, width(), TABLE_LINE_HEIGHT - 2, highlight ? COLOR_THEME_FOCUS : COLOR_THEME_SECONDARY3); coord_t x = 10; for (unsigned i = 0; i < line->cells.size(); i++) { auto cell = line->cells[i]; if (cell) { - cell->paint(dc, x, y, line->flags + (highlight ? MENU_HIGHLIGHT_COLOR - COLOR_MASK(line->flags) : DEFAULT_COLOR)); + cell->paint(dc, x, y, line->flags + (highlight ? COLOR_THEME_PRIMARY2 - COLOR_MASK(line->flags) : COLOR_THEME_SECONDARY1)); } x += static_cast