tileview asn scroll propagation improvments

This commit is contained in:
Gabor Kiss-Vamosi
2018-11-25 19:40:19 +01:00
parent 2cda0fc1fe
commit a9eb9f9ea5
5 changed files with 41 additions and 7 deletions

View File

@@ -833,9 +833,12 @@ static lv_res_t lv_list_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * para
res = ancestor_btn_signal(btn, sign, param);
if(res != LV_RES_OK) return res;
#if USE_LV_GROUP
if(sign == LV_SIGNAL_RELEASED) {
lv_obj_t * list = lv_obj_get_parent(lv_obj_get_parent(btn));
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
ext->page.scroll_prop_ip = 0;
#if USE_LV_GROUP
lv_group_t * g = lv_obj_get_group(list);
if(lv_group_get_focused(g) == list && lv_indev_is_dragging(lv_indev_get_act()) == false) {
/* Is the list is focused then be sure only the button being released
@@ -855,16 +858,23 @@ static lv_res_t lv_list_btn_signal(lv_obj_t * btn, lv_signal_t sign, void * para
/* If `click_focus == 1` then LV_SIGNAL_FOCUS need to know which button triggered the focus
* to mark it as selected (pressed state)*/
last_clicked_btn = btn;
#endif
}
if(sign == LV_SIGNAL_CLEANUP) {
else if(sign == LV_SIGNAL_PRESS_LOST) {
lv_obj_t * list = lv_obj_get_parent(lv_obj_get_parent(btn));
lv_list_ext_t * ext = lv_obj_get_ext_attr(list);
ext->page.scroll_prop_ip = 0;
}
else if(sign == LV_SIGNAL_CLEANUP) {
#if USE_LV_GROUP
lv_obj_t * list = lv_obj_get_parent(lv_obj_get_parent(btn));
lv_obj_t * sel = lv_list_get_btn_selected(list);
if(sel == btn) lv_list_set_btn_selected(list, lv_list_get_next_btn(list, btn));
#endif
}
#endif
return res;
}