From: Marcel Hollerbach Date: Fri, 26 Apr 2019 15:19:59 +0000 (+0200) Subject: efl_ui_pager: ensure deletion behavior X-Git-Tag: accepted/tizen/unified/20190509.041000~80 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38b4be9af0e542f6c69c490e9abcc105c3590839;p=platform%2Fupstream%2Fefl.git efl_ui_pager: ensure deletion behavior when a object is unpacked, we should ensure that only elements are deleted from the box when they are added. Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8742 --- diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c index b97737a..6047aa8 100644 --- a/src/lib/elementary/efl_ui_pager.c +++ b/src/lib/elementary/efl_ui_pager.c @@ -865,6 +865,8 @@ _unpack(Eo *obj, Efl_Gfx_Entity *subobj, int index) { + int self_index = eina_list_data_idx(pd->content_list, subobj); + int self_curr_page = pd->curr.page; pd->content_list = eina_list_remove(pd->content_list, subobj); pd->cnt--; @@ -885,9 +887,12 @@ _unpack(Eo *obj, } else { - efl_pack_unpack(pd->page_box, subobj); - if (pd->curr.page != -1) - efl_pack(pd->page_box, eina_list_nth(pd->content_list, pd->curr.page)); + if (self_curr_page == self_index) + { + efl_pack_unpack(pd->page_box, subobj); + pd->curr.page = -1; + efl_ui_pager_current_page_set(obj, self_curr_page); + } } if (pd->indicator)