Description
Hi:
Using large size Arc and Slider in tabview, and enable lv_obj_set_drag_parent. (LVGL V7.10)
When turning pages, if you touch Arc, the value of Arc will be changed. It should not have changed.
Sometimes touching arc will cause page turning. It was supposed to change the value of arc instead of turning the page.
What LVGL version are you using?
LVGL V7.10
What do you want to achieve?
1.Touch page turning does not change the value of Arc and Slider.
2.When you touch to change the values of the arc and slider, the page will not turn.
Code to reproduce
Add a code snippet which can run in the simulator. It should contain only the relevant code that compiles without errors when separated from your main code base.
The code block(s) should be formatted like:
/*You code here*/
/Create a test/
lv_obj_t* arc;
lv_obj_t* arc_label;
uint16_t arcValue;
void arc_event_cb(lv_obj_t* obj, lv_event_t event)
{
if (event == LV_EVENT_VALUE_CHANGED)
{
arcValue = lv_arc_get_value(arc);
uint8_t DataBuff[10];
sprintf(DataBuff, “%d”, arcValue);
lv_label_set_text(arc_label, DataBuff);//
}
}
void lv_tabview_Arc_Test(void)/////////////////////////////////////////////////
{
/Create a Tab view object/
lv_obj_t* tabview;
tabview = lv_tabview_create(lv_scr_act(), NULL);
lv_tabview_set_btns_pos(tabview, LV_TABVIEW_TAB_POS_NONE);/* Hide */
/*Add 3 tabs (the tabs are page (lv_page) and can be scrolled*/
lv_obj_t* tab1 = lv_tabview_add_tab(tabview, "Tab 1");
lv_obj_t* tab2 = lv_tabview_add_tab(tabview, "Tab 2");
lv_obj_t* tab3 = lv_tabview_add_tab(tabview, "Tab 3");
/*Add content to the tabs*/
lv_obj_t* label = lv_label_create(tab1, NULL);
lv_label_set_text(label, "This the first tab\n\n");
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 20);
/*Create an Arc*/
arc = lv_arc_create(tab1, NULL);
lv_obj_set_size(arc, 460, 460);
lv_arc_set_rotation(arc, 90);
lv_arc_set_bg_angles(arc, 0, 360);
lv_arc_set_value(arc, 50);
lv_obj_align(arc, NULL, LV_ALIGN_CENTER, 0, 0);
lv_arc_set_adjustable(arc, true);//
lv_obj_set_drag_parent(arc, true);
lv_obj_set_event_cb(arc, arc_event_cb);//
arc_label = lv_label_create(tab1, NULL);
uint8_t DataBuff[10];
sprintf(DataBuff, "%d", arcValue);
lv_label_set_text(arc_label, DataBuff);//
lv_obj_align(arc_label, arc, LV_ALIGN_CENTER, 0, 0);
label = lv_label_create(tab2, NULL);
lv_label_set_text(label, "Second tab");
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 20);
/*Create an Slider*/
lv_obj_t* slider = lv_slider_create(tab2, NULL);
lv_obj_set_size(slider, 460, 50);
lv_slider_set_range(slider, 0, 100);//
lv_slider_set_value(slider, 50, LV_ANIM_OFF);
lv_obj_align(slider, NULL, LV_ALIGN_CENTER, 0, 0);
lv_obj_set_drag_parent(slider, true);
label = lv_label_create(tab3, NULL);
lv_label_set_text(label, "Third tab");
lv_obj_align(label, NULL, LV_ALIGN_IN_TOP_MID, 0, 20);
}
Screenshot and/or video
If possible, add screenshots and/or videos about the current state.