summaryrefslogtreecommitdiff
path: root/src/tangara/ui/themes.cpp
diff options
context:
space:
mode:
authorailurux <ailuruxx@gmail.com>2024-08-12 03:19:03 +0000
committercooljqln <cooljqln@noreply.codeberg.org>2024-08-12 03:19:03 +0000
commitd719f9c5017ad8006c21b6d546a5d70e846e9502 (patch)
tree0da75c201e98d12b39c87743ee3ed242d2fc5809 /src/tangara/ui/themes.cpp
parent3d7b005dc98235899d1a9ae5a74bf11d916028b9 (diff)
downloadtangara-fw-d719f9c5017ad8006c21b6d546a5d70e846e9502.tar.gz
daniel/theme-setting (#87)
- Themes can be loaded from disk and built-in - Themes can be selected in a new themes menu of the settings screen - Some touch-ups to existing themes - The saved theme is persisted in nvs Reviewed-on: https://codeberg.org/cool-tech-zone/tangara-fw/pulls/87 Reviewed-by: cooljqln <cooljqln@noreply.codeberg.org> Co-authored-by: ailurux <ailuruxx@gmail.com> Co-committed-by: ailurux <ailuruxx@gmail.com>
Diffstat (limited to 'src/tangara/ui/themes.cpp')
-rw-r--r--src/tangara/ui/themes.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/tangara/ui/themes.cpp b/src/tangara/ui/themes.cpp
index 726bd5f0..3d532d10 100644
--- a/src/tangara/ui/themes.cpp
+++ b/src/tangara/ui/themes.cpp
@@ -16,6 +16,7 @@
#include "widgets/bar/lv_bar.h"
#include "widgets/button/lv_button.h"
#include "widgets/slider/lv_slider.h"
+#include "themes.hpp"
namespace ui {
namespace themes {
@@ -81,6 +82,10 @@ void Theme::ApplyStyle(lv_obj_t* obj, std::string style_key) {
}
}
+void Theme::Reset() {
+ style_map.clear();
+}
+
auto Theme::instance() -> Theme* {
static Theme sTheme{};
return &sTheme;