aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-26 17:19:59 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-04-30 20:45:46 +0200
commit92b5d969bcb6948e52c2d1a305db9143eef8d812 (patch)
treef8a72f82abcfdc7a7ede0ac217ada6007a2fa2f0
parentefl_ui_pager: ensure objects are added and deduplicated (diff)
downloadefl-92b5d969bcb6948e52c2d1a305db9143eef8d812.tar.gz
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 <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8742
-rw-r--r--src/lib/elementary/efl_ui_pager.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c
index b97737ab51..6047aa8d91 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)