forked from xiaozhi/xiaozhi-esp32
Add theme switch to all LCD boards
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user