feat: Add lvgl display theme control (#1180)

* feat: Add lvgl display theme control

* fix: compiling errors

* move light/dark themes to lcd display

* fix compile errors

---------

Co-authored-by: Xiaoxia <terrence.huang@tenclass.com>
This commit is contained in:
Xiaoxia
2025-09-10 18:43:47 +08:00
committed by GitHub
parent bce662d135
commit 4048647ef8
29 changed files with 882 additions and 617 deletions

View File

@@ -1,7 +1,7 @@
#ifndef LCD_DISPLAY_H
#define LCD_DISPLAY_H
#include "display.h"
#include "lvgl_display.h"
#include <esp_lcd_panel_io.h>
#include <esp_lcd_panel_ops.h>
@@ -12,21 +12,8 @@
#define PREVIEW_IMAGE_DURATION_MS 5000
// Theme color structure
struct ThemeColors {
lv_color_t background;
lv_color_t text;
lv_color_t chat_background;
lv_color_t user_bubble;
lv_color_t assistant_bubble;
lv_color_t system_bubble;
lv_color_t system_text;
lv_color_t border;
lv_color_t low_battery;
};
class LcdDisplay : public Display {
class LcdDisplay : public LvglDisplay {
protected:
esp_lcd_panel_io_handle_t panel_io_ = nullptr;
esp_lcd_panel_handle_t panel_ = nullptr;
@@ -41,8 +28,7 @@ protected:
lv_obj_t* emoji_box_ = nullptr;
esp_timer_handle_t preview_timer_ = nullptr;
ThemeColors current_theme_;
void InitializeLcdThemes();
void SetupUI();
virtual bool Lock(int timeout_ms = 0) override;
virtual void Unlock() override;
@@ -60,7 +46,7 @@ public:
#endif
// Add theme switching function
virtual void SetTheme(const std::string& theme_name) override;
virtual void SetTheme(Theme* theme) override;
};
// SPI LCD显示器