mirror of
https://github.com/lvgl/lvgl.git
synced 2026-05-10 04:37:55 +08:00
fix(themes): Fix mono theme init (#8343)
This commit is contained in:
@@ -127,6 +127,13 @@ lv_display_t * lv_display_create(int32_t hor_res, int32_t ver_res)
|
||||
else {
|
||||
disp->theme = lv_theme_simple_get();
|
||||
}
|
||||
#elif LV_USE_THEME_MONO
|
||||
if(lv_theme_mono_is_inited() == false) {
|
||||
disp->theme = lv_theme_mono_init(disp, false, LV_FONT_DEFAULT);
|
||||
}
|
||||
else {
|
||||
disp->theme = lv_theme_mono_get();
|
||||
}
|
||||
#endif
|
||||
|
||||
disp->bottom_layer = lv_obj_create(NULL); /*Create bottom layer on the display*/
|
||||
|
||||
@@ -515,6 +515,14 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
|
||||
#endif
|
||||
}
|
||||
|
||||
lv_theme_t * lv_theme_mono_get(void)
|
||||
{
|
||||
if(!lv_theme_mono_is_inited()) {
|
||||
return NULL;
|
||||
}
|
||||
return (lv_theme_t *)theme_def;
|
||||
}
|
||||
|
||||
/**********************
|
||||
* STATIC FUNCTIONS
|
||||
**********************/
|
||||
|
||||
@@ -44,6 +44,12 @@ lv_theme_t * lv_theme_mono_init(lv_display_t * disp, bool dark_bg, const lv_font
|
||||
*/
|
||||
bool lv_theme_mono_is_inited(void);
|
||||
|
||||
/**
|
||||
* Get mono theme
|
||||
* @return a pointer to mono theme, or NULL if this is not initialized
|
||||
*/
|
||||
lv_theme_t * lv_theme_mono_get(void);
|
||||
|
||||
/**
|
||||
* Deinitialize the mono theme
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user