fix(themes): Fix mono theme init (#8343)

This commit is contained in:
Fabian Blatz
2025-06-02 12:41:34 +02:00
committed by GitHub
parent 44b76b239e
commit 0fda1a577c
3 changed files with 21 additions and 0 deletions
+7
View File
@@ -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*/
+8
View File
@@ -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
**********************/
+6
View File
@@ -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
*/