Description
What MCU/Processor/Board and compiler are you using?
Simulator (Visual Studio)
What do you experience?
Upon start the button of the active tab is styled with “LV_TABVIEW_STYLE_BTN_TGL_PR” but the group is not in editing mode and therefore the button is not pressed.
What do you expect?
The button is styled with “LV_TABVIEW_STYLE_BTN_TGL_REL”.
Code to reproduce
mw_indev is the mouse wheel driver as encoder. Press the mouse wheel twice (long) to enter and then leave editing mode to get the expected style.
lv_style_t btn_rel;
lv_style_t btn_pr;
lv_style_t btn_tgl_rel;
lv_style_t btn_tgl_pr;
lv_style_copy(&btn_rel, &lv_style_btn_rel);
btn_rel.body.main_color = LV_COLOR_YELLOW;
btn_rel.body.grad_color = LV_COLOR_YELLOW;
lv_style_copy(&btn_pr, &lv_style_btn_pr);
btn_pr.body.main_color = LV_COLOR_BLUE;
btn_pr.body.grad_color = LV_COLOR_BLUE;
lv_style_copy(&btn_tgl_rel, &lv_style_btn_tgl_rel);
btn_tgl_rel.body.main_color = LV_COLOR_RED;
btn_tgl_rel.body.grad_color = LV_COLOR_RED;
lv_style_copy(&btn_tgl_pr, &lv_style_btn_tgl_pr);
btn_tgl_pr.body.main_color = LV_COLOR_GREEN;
btn_tgl_pr.body.grad_color = LV_COLOR_GREEN;
lv_obj_t* tabview;
tabview = lv_tabview_create(lv_scr_act(), NULL);
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_REL, &btn_rel);
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_PR, &btn_pr);
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_TGL_REL, &btn_tgl_rel);
lv_tabview_set_style(tabview, LV_TABVIEW_STYLE_BTN_TGL_PR, &btn_tgl_pr);
lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Tab 1");
lv_obj_t* tab2 = lv_tabview_add_tab(tabview, "Tab 2");
lv_group_t* g = lv_group_create();
lv_group_add_obj(g, tabview);
lv_indev_set_group(mw_indev, g);
Screenshot and/or video
Actual style after startup
Expected style after startup