diff options
| author | ailurux <ailuruxx@gmail.com> | 2024-03-07 14:20:06 +1100 |
|---|---|---|
| committer | ailurux <ailuruxx@gmail.com> | 2024-03-07 14:20:06 +1100 |
| commit | 312b70f9f6a2e3d7d387dfe3502f12f091e8fe37 (patch) | |
| tree | 09199fc4b378c80aaa334c4699762c0fa86d99ef /src/ui/include/themes.hpp | |
| parent | a78614a5806c9800956f10f993e1c70b74fbf323 (diff) | |
| download | tangara-fw-312b70f9f6a2e3d7d387dfe3502f12f091e8fe37.tar.gz | |
WIP: Base styles are applied
Diffstat (limited to 'src/ui/include/themes.hpp')
| -rw-r--r-- | src/ui/include/themes.hpp | 25 |
1 files changed, 7 insertions, 18 deletions
diff --git a/src/ui/include/themes.hpp b/src/ui/include/themes.hpp index 11680c0d..65462f65 100644 --- a/src/ui/include/themes.hpp +++ b/src/ui/include/themes.hpp @@ -1,5 +1,8 @@ #pragma once +#include <string> +#include <map> +#include <vector> #include "lvgl.h" namespace ui { @@ -21,29 +24,15 @@ class Theme { void Callback(lv_obj_t* obj); void ApplyStyle(lv_obj_t* obj, Style style); + void AddStyle(std::string key, int selector, lv_style_t* style); + static auto instance() -> Theme*; private: Theme(); - - lv_style_t base_style_; - lv_style_t base_focused_style_; - - lv_style_t button_style_; - lv_style_t bar_style_; - lv_style_t dropdown_style_; - lv_style_t dropdown_list_style_; - - lv_style_t slider_indicator_style_; - lv_style_t slider_knob_style_; - lv_style_t slider_knob_focused_style_; - - lv_style_t switch_style_; - lv_style_t switch_indicator_style_; - lv_style_t switch_indicator_checked_style_; - lv_style_t switch_knob_style_; - + std::map<std::string, std::vector<std::pair<int, lv_style_t*>>> style_map; lv_theme_t theme_; + }; } // namespace themes } // namespace ui |
