diff options
| author | cooljqln <cooljqln@noreply.codeberg.org> | 2024-03-28 05:36:38 +0000 |
|---|---|---|
| committer | cooljqln <cooljqln@noreply.codeberg.org> | 2024-03-28 05:36:38 +0000 |
| commit | 0175eaf1b5e79c53ac86adc568b67f018a5a7daf (patch) | |
| tree | d6b380746fb011c46c1c1aa2946005c6971a9c4e /src/ui/include | |
| parent | 35a822fe602cdc9e3a3482df3913ea33af6fc8c2 (diff) | |
| parent | 7c5dae84175aa750ca1b8beeb066f5607ca73181 (diff) | |
| download | tangara-fw-0175eaf1b5e79c53ac86adc568b67f018a5a7daf.tar.gz | |
Merge pull request 'themes' (#58) from themes into main
Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/58
Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org>
Diffstat (limited to 'src/ui/include')
| -rw-r--r-- | src/ui/include/themes.hpp | 27 |
1 files changed, 8 insertions, 19 deletions
diff --git a/src/ui/include/themes.hpp b/src/ui/include/themes.hpp index 11680c0d..09b9cdce 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 { @@ -19,31 +22,17 @@ class Theme { public: void Apply(void); void Callback(lv_obj_t* obj); - void ApplyStyle(lv_obj_t* obj, Style style); + void ApplyStyle(lv_obj_t* obj, std::string style_key); + + 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 |
