mirror of
https://github.com/eried/portapack-mayhem.git
synced 2025-07-30 01:59:13 -04:00
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:
parent
a8203a6372
commit
ced8012783
143 changed files with 1566 additions and 1154 deletions
|
@ -23,7 +23,6 @@
|
|||
#include "ui.hpp"
|
||||
#include "ui_language.hpp"
|
||||
#include "ui_widget.hpp"
|
||||
#include "ui_styles.hpp"
|
||||
#include "ui_navigation.hpp"
|
||||
#include "ui_tabview.hpp"
|
||||
#include "transmitter_model.hpp"
|
||||
|
@ -54,13 +53,13 @@ class RangeView : public View {
|
|||
uint32_t width{};
|
||||
rf::Frequency center{};
|
||||
|
||||
const Style& style_info = Styles::grey;
|
||||
const Style& style_info = *Theme::getInstance()->fg_medium;
|
||||
|
||||
Labels labels{
|
||||
{{2 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_START], Color::light_grey()},
|
||||
{{23 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_STOP], Color::light_grey()},
|
||||
{{12 * 8, 5 * 8 - 4}, "Center", Color::light_grey()},
|
||||
{{12 * 8 + 4, 13 * 8}, "Width", Color::light_grey()}};
|
||||
{{2 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_START], Theme::getInstance()->fg_light->foreground},
|
||||
{{23 * 8, 8 * 8 + 4}, LanguageHelper::currentMessages[LANG_STOP], Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8, 5 * 8 - 4}, "Center", Theme::getInstance()->fg_light->foreground},
|
||||
{{12 * 8 + 4, 13 * 8}, "Width", Theme::getInstance()->fg_light->foreground}};
|
||||
|
||||
Checkbox check_enabled{
|
||||
{1 * 8, 4},
|
||||
|
@ -120,8 +119,8 @@ class JammerView : public View {
|
|||
int16_t mscounter = 0; // euquiq: Internal ms counter for do_timer()
|
||||
lfsr_word_t lfsr_v = 1; // euquiq: Used to generate "random" Jitter
|
||||
|
||||
const Style& style_val = Styles::green;
|
||||
const Style& style_cancel = Styles::red;
|
||||
const Style& style_val = *Theme::getInstance()->fg_green;
|
||||
const Style& style_cancel = *Theme::getInstance()->fg_red;
|
||||
|
||||
RangeView view_range_a{nav_};
|
||||
RangeView view_range_b{nav_};
|
||||
|
@ -130,23 +129,23 @@ class JammerView : public View {
|
|||
std::array<RangeView*, 3> range_views{{&view_range_a, &view_range_b, &view_range_c}};
|
||||
|
||||
TabView tab_view{
|
||||
{"Range 1", Color::white(), range_views[0]},
|
||||
{"Range 2", Color::white(), range_views[1]},
|
||||
{"Range 3", Color::white(), range_views[2]},
|
||||
{"Range 1", Theme::getInstance()->bg_darkest->foreground, range_views[0]},
|
||||
{"Range 2", Theme::getInstance()->bg_darkest->foreground, range_views[1]},
|
||||
{"Range 3", Theme::getInstance()->bg_darkest->foreground, range_views[2]},
|
||||
};
|
||||
|
||||
Labels labels{
|
||||
{{2 * 8, 23 * 8}, "Type:", Color::light_grey()},
|
||||
{{1 * 8, 25 * 8}, "Speed:", Color::light_grey()},
|
||||
{{3 * 8, 27 * 8}, "Hop:", Color::light_grey()},
|
||||
{{4 * 8, 29 * 8}, "TX:", Color::light_grey()},
|
||||
{{1 * 8, 31 * 8}, "Sle3p:", Color::light_grey()}, // euquiq: Token of appreciation to TheSle3p, which made this ehnancement a reality with his bounty.
|
||||
{{0 * 8, 33 * 8}, "Jitter:", Color::light_grey()}, // Maybe the repository curator can keep the "mystype" for some versions.
|
||||
{{11 * 8, 29 * 8}, "Secs.", Color::light_grey()},
|
||||
{{11 * 8, 31 * 8}, "Secs.", Color::light_grey()},
|
||||
{{11 * 8, 33 * 8}, "/60", Color::light_grey()},
|
||||
{{2 * 8, 35 * 8}, "Gain:", Color::light_grey()},
|
||||
{{11 * 8, 35 * 8}, "A:", Color::light_grey()}};
|
||||
{{2 * 8, 23 * 8}, "Type:", Theme::getInstance()->fg_light->foreground},
|
||||
{{1 * 8, 25 * 8}, "Speed:", Theme::getInstance()->fg_light->foreground},
|
||||
{{3 * 8, 27 * 8}, "Hop:", Theme::getInstance()->fg_light->foreground},
|
||||
{{4 * 8, 29 * 8}, "TX:", Theme::getInstance()->fg_light->foreground},
|
||||
{{1 * 8, 31 * 8}, "Sle3p:", Theme::getInstance()->fg_light->foreground}, // euquiq: Token of appreciation to TheSle3p, which made this ehnancement a reality with his bounty.
|
||||
{{0 * 8, 33 * 8}, "Jitter:", Theme::getInstance()->fg_light->foreground}, // Maybe the repository curator can keep the "mystype" for some versions.
|
||||
{{11 * 8, 29 * 8}, "Secs.", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 31 * 8}, "Secs.", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 33 * 8}, "/60", Theme::getInstance()->fg_light->foreground},
|
||||
{{2 * 8, 35 * 8}, "Gain:", Theme::getInstance()->fg_light->foreground},
|
||||
{{11 * 8, 35 * 8}, "A:", Theme::getInstance()->fg_light->foreground}};
|
||||
|
||||
OptionsField options_type{
|
||||
{7 * 8, 23 * 8},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue