forked from xiaozhi/xiaozhi-esp32
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:
31
main/display/lvgl_display/lvgl_font.h
Normal file
31
main/display/lvgl_display/lvgl_font.h
Normal file
@@ -0,0 +1,31 @@
|
||||
#pragma once
|
||||
|
||||
#include <lvgl.h>
|
||||
|
||||
|
||||
class LvglFont {
|
||||
public:
|
||||
virtual const lv_font_t* font() const = 0;
|
||||
virtual ~LvglFont() = default;
|
||||
};
|
||||
|
||||
// Built-in font
|
||||
class LvglBuiltInFont : public LvglFont {
|
||||
public:
|
||||
LvglBuiltInFont(const lv_font_t* font) : font_(font) {}
|
||||
virtual const lv_font_t* font() const override { return font_; }
|
||||
|
||||
private:
|
||||
const lv_font_t* font_;
|
||||
};
|
||||
|
||||
|
||||
class LvglCBinFont : public LvglFont {
|
||||
public:
|
||||
LvglCBinFont(void* data);
|
||||
virtual ~LvglCBinFont();
|
||||
virtual const lv_font_t* font() const override { return font_; }
|
||||
|
||||
private:
|
||||
lv_font_t* font_;
|
||||
};
|
||||
Reference in New Issue
Block a user