fix(theme): limit the theme applied tabview header buttons (#5309)

This commit is contained in:
Gabor Kiss-Vamosi
2024-01-14 15:06:46 +01:00
committed by GitHub
parent 2cbeddce8a
commit 1e1caef813
+10 -8
View File
@@ -786,14 +786,16 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj)
#if LV_USE_TABVIEW
lv_obj_t * parent = lv_obj_get_parent(obj);
if(parent && lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) {
lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.tab_btn, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY);
return;
if(parent && lv_obj_get_index(parent) == 0) { /*Tabview header*/
if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) {
lv_obj_add_style(obj, &theme->styles.pressed, LV_STATE_PRESSED);
lv_obj_add_style(obj, &theme->styles.bg_color_primary_muted, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.tab_btn, LV_STATE_CHECKED);
lv_obj_add_style(obj, &theme->styles.outline_primary, LV_STATE_FOCUS_KEY);
lv_obj_add_style(obj, &theme->styles.outline_secondary, LV_STATE_EDITED);
lv_obj_add_style(obj, &theme->styles.tab_bg_focus, LV_STATE_FOCUS_KEY);
return;
}
}
#endif