diff --git a/lv_themes/lv_theme.c b/lv_themes/lv_theme.c index 4c76cb00ea..3db5a4cdcd 100644 --- a/lv_themes/lv_theme.c +++ b/lv_themes/lv_theme.c @@ -80,8 +80,10 @@ void lv_theme_set_current(lv_theme_t * th) if(s) memcpy(&th_styles[i], (void *)s, sizeof(lv_style_t)); } +#if USE_LV_GROUP /*Copy group style modification callback functions*/ memcpy(¤t_theme.group, &th->group, sizeof(th->group)); +#endif /*Let the object know their style might change*/ lv_obj_report_style_mod(NULL); diff --git a/lv_themes/lv_theme.h b/lv_themes/lv_theme.h index 8d681feae9..66bbd3d2db 100644 --- a/lv_themes/lv_theme.h +++ b/lv_themes/lv_theme.h @@ -293,11 +293,13 @@ typedef struct { #endif } style; +#if USE_LV_GROUP struct { lv_group_style_mod_func_t style_mod; lv_group_style_mod_func_t style_mod_edit; } group; +#endif } lv_theme_t; /********************** diff --git a/lv_themes/lv_theme_alien.c b/lv_themes/lv_theme_alien.c index 90d699d8a4..45f706ee42 100644 --- a/lv_themes/lv_theme_alien.c +++ b/lv_themes/lv_theme_alien.c @@ -806,6 +806,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -841,6 +843,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -897,8 +901,10 @@ lv_theme_t * lv_theme_alien_init(uint16_t hue, lv_font_t * font) table_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_default.c b/lv_themes/lv_theme_default.c index cc6dd3d609..3a65455d44 100644 --- a/lv_themes/lv_theme_default.c +++ b/lv_themes/lv_theme_default.c @@ -355,6 +355,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -399,6 +401,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -450,8 +454,10 @@ lv_theme_t * lv_theme_default_init(uint16_t hue, lv_font_t * font) tabview_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_material.c b/lv_themes/lv_theme_material.c index 2fc54789c8..812dfd362a 100644 --- a/lv_themes/lv_theme_material.c +++ b/lv_themes/lv_theme_material.c @@ -785,6 +785,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -829,6 +831,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -887,8 +891,10 @@ lv_theme_t * lv_theme_material_init(uint16_t hue, lv_font_t * font) table_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_mono.c b/lv_themes/lv_theme_mono.c index 982e7703f6..25ce93f890 100644 --- a/lv_themes/lv_theme_mono.c +++ b/lv_themes/lv_theme_mono.c @@ -412,6 +412,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -444,6 +446,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -499,8 +503,10 @@ lv_theme_t * lv_theme_mono_init(uint16_t hue, lv_font_t * font) tabview_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_nemo.c b/lv_themes/lv_theme_nemo.c index b9bd21fc30..5550a53523 100644 --- a/lv_themes/lv_theme_nemo.c +++ b/lv_themes/lv_theme_nemo.c @@ -781,6 +781,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -800,6 +802,8 @@ static void style_mod(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -855,8 +859,10 @@ lv_theme_t * lv_theme_nemo_init(uint16_t hue, lv_font_t * font) table_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod; +#endif return &theme; } diff --git a/lv_themes/lv_theme_night.c b/lv_themes/lv_theme_night.c index ee99285c90..047c811a60 100644 --- a/lv_themes/lv_theme_night.c +++ b/lv_themes/lv_theme_night.c @@ -695,6 +695,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -727,6 +729,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -785,8 +789,10 @@ lv_theme_t * lv_theme_night_init(uint16_t hue, lv_font_t * font) table_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_templ.c b/lv_themes/lv_theme_templ.c index 8cbb1b3078..46f3793b7e 100644 --- a/lv_themes/lv_theme_templ.c +++ b/lv_themes/lv_theme_templ.c @@ -364,6 +364,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -408,6 +410,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -463,8 +467,10 @@ lv_theme_t * lv_theme_templ_init(uint16_t hue, lv_font_t * font) tabview_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; } diff --git a/lv_themes/lv_theme_zen.c b/lv_themes/lv_theme_zen.c index 4419ebc6b3..c55e8c8de4 100644 --- a/lv_themes/lv_theme_zen.c +++ b/lv_themes/lv_theme_zen.c @@ -758,6 +758,8 @@ static void win_init(void) #endif } +#if USE_LV_GROUP + static void style_mod(lv_style_t * style) { #if LV_COLOR_DEPTH != 1 @@ -796,6 +798,8 @@ static void style_mod_edit(lv_style_t * style) #endif } +#endif /*USE_LV_GROUP*/ + /********************** * GLOBAL FUNCTIONS **********************/ @@ -854,8 +858,10 @@ lv_theme_t * lv_theme_zen_init(uint16_t hue, lv_font_t * font) table_init(); win_init(); +#if USE_LV_GROUP theme.group.style_mod = style_mod; theme.group.style_mod_edit = style_mod_edit; +#endif return &theme; }