1
0
mirror of https://github.com/lvgl/lvgl.git synced 2025-01-28 07:03:00 +08:00

fix(theme): fix operating without default theme

This commit is contained in:
Gabor Kiss-Vamosi 2021-02-15 19:34:35 +01:00
parent 981f63c3fa
commit fcc9f725a5
2 changed files with 3 additions and 1 deletions

View File

@ -125,12 +125,13 @@ void lv_init(void)
_lv_ll_init(&LV_GC_ROOT(_lv_disp_ll), sizeof(lv_disp_t));
_lv_ll_init(&LV_GC_ROOT(_lv_indev_ll), sizeof(lv_indev_t));
#ifdef LV_THEME_INIT
lv_theme_t * th = LV_THEME_INIT(LV_THEME_COLOR_PRIMARY, LV_THEME_COLOR_SECONDARY,
LV_THEME_FONT_SMALL, LV_THEME_FONT_NORMAL,
LV_THEME_FONT_LARGE, LV_THEME_FONT_EXTRA_LARGE);
lv_theme_set_act(th);
#endif
/*Initialize the screen refresh system*/
_lv_refr_init();

View File

@ -64,6 +64,7 @@ void lv_theme_apply(lv_obj_t * obj)
lv_obj_remove_style(obj, LV_PART_ANY, LV_STATE_ANY, NULL);
if(act_theme == NULL) return;
apply_theme(act_theme, obj); /*Apply the theme including the base theme(s)*/
lv_obj_enable_style_refresh(true);