diff --git a/src/display/lv_display.c b/src/display/lv_display.c index 8d47dfca42..e30022efd4 100644 --- a/src/display/lv_display.c +++ b/src/display/lv_display.c @@ -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*/ diff --git a/src/themes/mono/lv_theme_mono.c b/src/themes/mono/lv_theme_mono.c index cd71ecb3de..9f69f7b02b 100644 --- a/src/themes/mono/lv_theme_mono.c +++ b/src/themes/mono/lv_theme_mono.c @@ -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 **********************/ diff --git a/src/themes/mono/lv_theme_mono.h b/src/themes/mono/lv_theme_mono.h index 30ac4c4882..794411b499 100644 --- a/src/themes/mono/lv_theme_mono.h +++ b/src/themes/mono/lv_theme_mono.h @@ -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 */