Add theme switch to all LCD boards

This commit is contained in:
Terrence
2025-03-20 03:00:07 +08:00
parent 71799ed85c
commit 6bb1ab7583
36 changed files with 73 additions and 119 deletions

View File

@@ -15,6 +15,10 @@
#define TAG "Display"
Display::Display() {
// Load theme from settings
Settings settings("display", false);
current_theme_name_ = settings.GetString("theme", "light");
// Notification timer
esp_timer_create_args_t notification_timer_args = {
.callback = [](void *arg) {
@@ -249,3 +253,9 @@ void Display::SetChatMessage(const char* role, const char* content) {
}
lv_label_set_text(chat_message_label_, content);
}
void Display::SetTheme(const std::string& theme_name) {
current_theme_name_ = theme_name;
Settings settings("display", true);
settings.SetString("theme", theme_name);
}