Theme system (#2164)

* Themes instead of Styles
* Colors changed to theme colors
* Reworked style management
* Theme settings app
* warn, menu dual set
* Added Aqua style
This commit is contained in:
Totoo 2024-05-27 21:02:52 +02:00 committed by GitHub
parent a8203a6372
commit ced8012783
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
143 changed files with 1566 additions and 1154 deletions

View file

@ -40,13 +40,13 @@ namespace ui {
/* Gets a style indicating total TX gain level. */
static const Style* get_style_for_gain(uint8_t tot_gain) {
if (tot_gain > POWER_THRESHOLD_HIGH) return &Styles::red;
if (tot_gain > POWER_THRESHOLD_HIGH) return Theme::getInstance()->fg_red;
if (tot_gain > POWER_THRESHOLD_MED)
return &Styles::orange;
return Theme::getInstance()->fg_orange;
if (tot_gain > POWER_THRESHOLD_LOW)
return &Styles::yellow;
return Theme::getInstance()->fg_yellow;
return nullptr; // Uses default.
}
@ -61,8 +61,8 @@ void TransmitterView::paint(Painter& painter) {
painter.draw_bitmap(
pos,
bitmap_stripes,
ui::Color(191, 191, 0),
ui::Color::black());
Theme::getInstance()->fg_yellow->foreground,
Theme::getInstance()->fg_yellow->background);
if (c != 9)
pos += {24, 0};
else