diff --git a/src/extra/themes/basic/lv_theme_basic.c b/src/extra/themes/basic/lv_theme_basic.c index a68f10ab3..caf49825f 100644 --- a/src/extra/themes/basic/lv_theme_basic.c +++ b/src/extra/themes/basic/lv_theme_basic.c @@ -16,9 +16,9 @@ /********************* * DEFINES *********************/ -#define COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 3) +#define COLOR_SCR lv_palette_lighten(LV_PALETTE_GREY, 4) #define COLOR_WHITE lv_color_white() -#define COLOR_LIGHT lv_palette_lighten(LV_PALETTE_GREY, 1) +#define COLOR_LIGHT lv_palette_lighten(LV_PALETTE_GREY, 2) #define COLOR_DARK lv_palette_main(LV_PALETTE_GREY) #define COLOR_DIM lv_palette_darken(LV_PALETTE_GREY, 2) #define SCROLLBAR_WIDTH 2 @@ -122,7 +122,7 @@ static void style_init(void) bool lv_theme_basic_is_inited(void) { - return LV_GC_ROOT(_lv_theme_default_styles) == NULL ? false : true; + return LV_GC_ROOT(_lv_theme_basic_styles) == NULL ? false : true; } lv_theme_t * lv_theme_basic_init(lv_disp_t * disp) @@ -133,8 +133,8 @@ lv_theme_t * lv_theme_basic_init(lv_disp_t * disp) *In a general case styles could be in simple `static lv_style_t my_style...` variables*/ if(!lv_theme_basic_is_inited()) { inited = false; - LV_GC_ROOT(_lv_theme_default_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); - styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_default_styles); + LV_GC_ROOT(_lv_theme_basic_styles) = lv_mem_alloc(sizeof(my_theme_styles_t)); + styles = (my_theme_styles_t *)LV_GC_ROOT(_lv_theme_basic_styles); } theme.disp = disp; @@ -257,7 +257,7 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) #if LV_USE_SWITCH else if(lv_obj_check_type(obj, &lv_switch_class)) { lv_obj_add_style(obj, &styles->light, 0); - lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR); + lv_obj_add_style(obj, &styles->dark, LV_PART_INDICATOR | LV_STATE_CHECKED); lv_obj_add_style(obj, &styles->dim, LV_PART_KNOB); } #endif diff --git a/src/misc/lv_gc.h b/src/misc/lv_gc.h index b76ee2f74..7551252a5 100644 --- a/src/misc/lv_gc.h +++ b/src/misc/lv_gc.h @@ -57,6 +57,7 @@ extern "C" { LV_DISPATCH_COND(f, _lv_draw_mask_radius_circle_dsc_arr_t , _lv_circle_cache, LV_DRAW_COMPLEX, 1) \ LV_DISPATCH_COND(f, _lv_draw_mask_saved_arr_t , _lv_draw_mask_list, LV_DRAW_COMPLEX, 1) \ LV_DISPATCH(f, void * , _lv_theme_default_styles) \ + LV_DISPATCH(f, void * , _lv_theme_basic_styles) \ LV_DISPATCH_COND(f, uint8_t *, _lv_font_decompr_buf, LV_USE_FONT_COMPRESSED, 1) \ LV_DISPATCH(f, uint8_t * , _lv_grad_cache_mem)