在Display基类中添加SetupUI虚函数 (#1742)

Signed-off-by: jeck.chen <jeck.chen@dbappsecurity.com.cn>
This commit is contained in:
baidxi
2026-02-04 21:03:08 +08:00
committed by GitHub
parent 2b025c4ea6
commit 173eaa7463
4 changed files with 3 additions and 9 deletions

View File

@@ -64,7 +64,7 @@ void Application::Initialize() {
// Setup the display
auto display = board.GetDisplay();
display->SetupUI();
// Print board name/version info
display->SetChatMessage("system", SystemInfo::GetUserAgent().c_str());

View File

@@ -40,6 +40,7 @@ public:
virtual Theme* GetTheme() { return current_theme_; }
virtual void UpdateStatusBar(bool update_all = false);
virtual void SetPowerSaveMode(bool on);
virtual void SetupUI() { }
inline int width() const { return width_; }
inline int height() const { return height_; }

View File

@@ -169,8 +169,6 @@ SpiLcdDisplay::SpiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_h
if (offset_x != 0 || offset_y != 0) {
lv_display_set_offset(display_, offset_x, offset_y);
}
SetupUI();
}
@@ -232,8 +230,6 @@ RgbLcdDisplay::RgbLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_h
if (offset_x != 0 || offset_y != 0) {
lv_display_set_offset(display_, offset_x, offset_y);
}
SetupUI();
}
MipiLcdDisplay::MipiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel_handle_t panel,
@@ -285,8 +281,6 @@ MipiLcdDisplay::MipiLcdDisplay(esp_lcd_panel_io_handle_t panel_io, esp_lcd_panel
if (offset_x != 0 || offset_y != 0) {
lv_display_set_offset(display_, offset_x, offset_y);
}
SetupUI();
}
LcdDisplay::~LcdDisplay() {

View File

@@ -37,7 +37,6 @@ protected:
bool hide_subtitle_ = false; // Control whether to hide chat messages/subtitles
void InitializeLcdThemes();
void SetupUI();
virtual bool Lock(int timeout_ms = 0) override;
virtual void Unlock() override;
@@ -51,7 +50,7 @@ public:
virtual void SetChatMessage(const char* role, const char* content) override;
virtual void ClearChatMessages() override;
virtual void SetPreviewImage(std::unique_ptr<LvglImage> image) override;
virtual void SetupUI() override;
// Add theme switching function
virtual void SetTheme(Theme* theme) override;