mirror of
https://github.com/lvgl/lvgl.git
synced 2025-01-28 07:03:00 +08:00
refactor(scroll): lv_obj_scroll_to_obj -> lv_obj_scroll_to_child
This commit is contained in:
parent
70d00469c6
commit
fe5796f268
@ -1935,7 +1935,7 @@ static lv_res_t lv_obj_signal(lv_obj_t * obj, lv_signal_t sign, void * param)
|
||||
lv_obj_t * parent = lv_obj_get_parent(obj);
|
||||
lv_obj_t * child = obj;
|
||||
while(parent && lv_obj_has_flag(child, LV_OBJ_FLAG_FOCUS_SCROLL)) {
|
||||
lv_obj_scroll_to_obj(parent, child, LV_ANIM_ON);
|
||||
lv_obj_scroll_to_child(parent, child, LV_ANIM_ON);
|
||||
child = parent;
|
||||
parent = lv_obj_get_parent(parent);
|
||||
}
|
||||
|
@ -330,7 +330,7 @@ void lv_obj_scroll_to_y(lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t anim_en)
|
||||
lv_obj_scroll_by(obj, 0, -y + lv_obj_get_scroll_y(obj), anim_en);
|
||||
}
|
||||
|
||||
void lv_obj_scroll_to_obj(lv_obj_t * obj, lv_obj_t * child, lv_anim_enable_t anim_en)
|
||||
void lv_obj_scroll_to_child(lv_obj_t * obj, lv_obj_t * child, lv_anim_enable_t anim_en)
|
||||
{
|
||||
lv_coord_t pleft = lv_obj_get_style_pad_left(obj, LV_OBJ_PART_MAIN);
|
||||
lv_coord_t pright = lv_obj_get_style_pad_right(obj, LV_OBJ_PART_MAIN);
|
||||
|
@ -232,7 +232,7 @@ void lv_obj_scroll_to_y(struct _lv_obj_t * obj, lv_coord_t y, lv_anim_enable_t a
|
||||
* @param child pointer to an object to which scrolling should happen
|
||||
* @param anim_en LV_ANIM_ON: scroll with animation; LV_ANIM_OFF: scroll immediately
|
||||
*/
|
||||
void lv_obj_scroll_to_obj(struct _lv_obj_t * obj, struct _lv_obj_t * child, lv_anim_enable_t anim_en);
|
||||
void lv_obj_scroll_to_child(struct _lv_obj_t * obj, struct _lv_obj_t * child, lv_anim_enable_t anim_en);
|
||||
|
||||
/**********************
|
||||
* MACROS
|
||||
|
Loading…
x
Reference in New Issue
Block a user