lv_page: fix arrow scroll

This commit is contained in:
Gabor Kiss-Vamosi
2019-03-12 15:17:28 +01:00
parent 3458b1bfb1
commit 6967a8e52f
2 changed files with 15 additions and 8 deletions

View File

@@ -806,12 +806,12 @@ static lv_res_t lv_page_signal(lv_obj_t * page, lv_signal_t sign, void * param)
} else if((c == LV_GROUP_KEY_UP) && ext->arrow_scroll) {
lv_page_scroll_ver(page, lv_obj_get_height(page) / 4);
} else if((c == LV_GROUP_KEY_RIGHT) && ext->arrow_scroll) {
/*If the page can be scrolled horizontally because it's not wide enough then scroll it vertically*/
if(lv_page_get_scrl_width(page) < lv_obj_get_width(page)) lv_page_scroll_ver(page, - lv_obj_get_height(page) / 4);
/*If the page can't be scrolled horizontally because it's not wide enough then scroll it vertically*/
if(lv_page_get_scrl_width(page) <= lv_obj_get_width(page)) lv_page_scroll_ver(page, - lv_obj_get_height(page) / 4);
else lv_page_scroll_hor(page, - lv_obj_get_width(page) / 4);
} else if((c == LV_GROUP_KEY_LEFT) && ext->arrow_scroll) {
/*If the page can be scrolled horizontally because it's not wide enough then scroll it vertically*/
if(lv_page_get_scrl_width(page) < lv_obj_get_width(page)) lv_page_scroll_ver(page, lv_obj_get_height(page) / 4);
/*If the page can't be scrolled horizontally because it's not wide enough then scroll it vertically*/
if(lv_page_get_scrl_width(page) <= lv_obj_get_width(page)) lv_page_scroll_ver(page, lv_obj_get_height(page) / 4);
else lv_page_scroll_hor(page, lv_obj_get_width(page) / 4);
}
} else if(sign == LV_SIGNAL_GET_EDITABLE) {