From 511d9d8c504d6717f7d3d844bffb8ff5cca5e317 Mon Sep 17 00:00:00 2001 From: Gabor Kiss-Vamosi Date: Sun, 18 Apr 2021 00:55:11 +0200 Subject: [PATCH] fix(theme) update the tabview's theme Allow setting background color directly on the tabview --- src/extra/themes/default/lv_theme_default.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/extra/themes/default/lv_theme_default.c b/src/extra/themes/default/lv_theme_default.c index 0201027d6..ed736e827 100644 --- a/src/extra/themes/default/lv_theme_default.c +++ b/src/extra/themes/default/lv_theme_default.c @@ -589,13 +589,10 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) lv_obj_t * parent = lv_obj_get_parent(obj); /*Tabview content area*/ if(lv_obj_check_type(parent, &lv_tabview_class)) { - lv_obj_add_style(obj, &styles->bg_color_grey, 0); - lv_obj_add_style(obj, &styles->pad_gap, 0); return; } /*Tabview pages*/ else if(lv_obj_check_type(lv_obj_get_parent(parent), &lv_tabview_class)) { - lv_obj_add_style(obj, &styles->scr, 0); lv_obj_add_style(obj, &styles->pad_normal, 0); lv_obj_add_style(obj, &styles->scrollbar, LV_PART_SCROLLBAR); lv_obj_add_style(obj, &styles->scrollbar_scrolled, LV_PART_SCROLLBAR | LV_STATE_SCROLLED); @@ -915,6 +912,13 @@ static void theme_apply(lv_theme_t * th, lv_obj_t * obj) } #endif +#if LV_USE_TABVIEW + if(lv_obj_check_type(obj, &lv_tabview_class)) { + lv_obj_add_style(obj, &styles->scr, 0); + return; + } +#endif + #if LV_USE_COLORWHEEL else if(lv_obj_check_type(obj, &lv_colorwheel_class)) { lv_obj_add_style(obj, &styles->colorwheel_main, 0);