zmike pushed a commit to branch efl-1.22.

http://git.enlightenment.org/core/efl.git/commit/?id=a8b82f94d9b47e55197ab4a4fd3660deb04ada64

commit a8b82f94d9b47e55197ab4a4fd3660deb04ada64
Author: Marcel Hollerbach <[email protected]>
Date:   Fri Apr 26 17:19:59 2019 +0200

    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 <[email protected]>
    Differential Revision: https://phab.enlightenment.org/D8742
---
 src/lib/elementary/efl_ui_pager.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/src/lib/elementary/efl_ui_pager.c 
b/src/lib/elementary/efl_ui_pager.c
index a82c83775a..9752372028 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -817,6 +817,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--;
 
@@ -837,9 +839,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)

-- 


Reply via email to