在Display基类中添加SetupUI虚函数 (#1742)
Signed-off-by: jeck.chen <jeck.chen@dbappsecurity.com.cn>
This commit is contained in:
@ -64,7 +64,7 @@ void Application::Initialize() {
|
|||||||
|
|
||||||
// Setup the display
|
// Setup the display
|
||||||
auto display = board.GetDisplay();
|
auto display = board.GetDisplay();
|
||||||
|
display->SetupUI();
|
||||||
// Print board name/version info
|
// Print board name/version info
|
||||||
display->SetChatMessage("system", SystemInfo::GetUserAgent().c_str());
|
display->SetChatMessage("system", SystemInfo::GetUserAgent().c_str());
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@ public:
|
|||||||
virtual Theme* GetTheme() { return current_theme_; }
|
virtual Theme* GetTheme() { return current_theme_; }
|
||||||
virtual void UpdateStatusBar(bool update_all = false);
|
virtual void UpdateStatusBar(bool update_all = false);
|
||||||
virtual void SetPowerSaveMode(bool on);
|
virtual void SetPowerSaveMode(bool on);
|
||||||
|
virtual void SetupUI() { }
|
||||||
|
|
||||||
inline int width() const { return width_; }
|
inline int width() const { return width_; }
|
||||||
inline int height() const { return height_; }
|
inline int height() const { return height_; }
|
||||||
|
|||||||
@ -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) {
|
if (offset_x != 0 || offset_y != 0) {
|
||||||
lv_display_set_offset(display_, offset_x, offset_y);
|
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) {
|
if (offset_x != 0 || offset_y != 0) {
|
||||||
lv_display_set_offset(display_, offset_x, offset_y);
|
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,
|
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) {
|
if (offset_x != 0 || offset_y != 0) {
|
||||||
lv_display_set_offset(display_, offset_x, offset_y);
|
lv_display_set_offset(display_, offset_x, offset_y);
|
||||||
}
|
}
|
||||||
|
|
||||||
SetupUI();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
LcdDisplay::~LcdDisplay() {
|
LcdDisplay::~LcdDisplay() {
|
||||||
|
|||||||
@ -37,7 +37,6 @@ protected:
|
|||||||
bool hide_subtitle_ = false; // Control whether to hide chat messages/subtitles
|
bool hide_subtitle_ = false; // Control whether to hide chat messages/subtitles
|
||||||
|
|
||||||
void InitializeLcdThemes();
|
void InitializeLcdThemes();
|
||||||
void SetupUI();
|
|
||||||
virtual bool Lock(int timeout_ms = 0) override;
|
virtual bool Lock(int timeout_ms = 0) override;
|
||||||
virtual void Unlock() override;
|
virtual void Unlock() override;
|
||||||
|
|
||||||
@ -51,7 +50,7 @@ public:
|
|||||||
virtual void SetChatMessage(const char* role, const char* content) override;
|
virtual void SetChatMessage(const char* role, const char* content) override;
|
||||||
virtual void ClearChatMessages() override;
|
virtual void ClearChatMessages() override;
|
||||||
virtual void SetPreviewImage(std::unique_ptr<LvglImage> image) override;
|
virtual void SetPreviewImage(std::unique_ptr<LvglImage> image) override;
|
||||||
|
virtual void SetupUI() override;
|
||||||
// Add theme switching function
|
// Add theme switching function
|
||||||
virtual void SetTheme(Theme* theme) override;
|
virtual void SetTheme(Theme* theme) override;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user