summaryrefslogtreecommitdiff
path: root/src/ui/include/themes.hpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-04-02 11:13:50 +1100
committerailurux <ailuruxx@gmail.com>2024-04-02 11:13:50 +1100
commite20ebe7574db5aedc73f07b7bb3a0a01eae93c84 (patch)
tree34c93ec8a80e282f3ce3e47dd60c41e46de0f8b3 /src/ui/include/themes.hpp
parenta750af35aa6afda40aadca8f7cf8db75f41a43b2 (diff)
parent0d0c4b2307cac8436fea7276956f293262b265ed (diff)
downloadtangara-fw-e20ebe7574db5aedc73f07b7bb3a0a01eae93c84.tar.gz
Merge branch 'main' into lua-volume
Diffstat (limited to 'src/ui/include/themes.hpp')
-rw-r--r--src/ui/include/themes.hpp27
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