eunue pushed a commit to branch master.

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

commit 20dfa5c4871d7e9034ab9b0264b36670847cee8a
Author: Jaeun Choi <jaeun12.c...@samsung.com>
Date:   Tue Feb 19 18:44:26 2019 +0900

    efl_ui_pager: disable loop if items are not enough after unpacking
---
 src/lib/elementary/efl_ui_pager.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/src/lib/elementary/efl_ui_pager.c 
b/src/lib/elementary/efl_ui_pager.c
index b8ceb97bca..e5f65c55d3 100644
--- a/src/lib/elementary/efl_ui_pager.c
+++ b/src/lib/elementary/efl_ui_pager.c
@@ -799,7 +799,7 @@ _efl_ui_pager_efl_pack_unpack_all(Eo *obj EINA_UNUSED,
 }
 
 EOLIAN static Eina_Bool
-_efl_ui_pager_efl_pack_unpack(Eo *obj EINA_UNUSED,
+_efl_ui_pager_efl_pack_unpack(Eo *obj,
                               Efl_Ui_Pager_Data *pd,
                               Efl_Gfx_Entity *subobj)
 {
@@ -817,10 +817,17 @@ _efl_ui_pager_efl_pack_unpack(Eo *obj EINA_UNUSED,
        (index < pd->curr.page))
      pd->curr.page--;
 
-   //FIXME if the number of pages is not enough after unpacking a page,
-   //      loop mode needs to be disabled
    if (pd->transition)
-     efl_page_transition_update(pd->transition, pd->curr.pos);
+     {
+        // if the number of pages is not enough after unpacking a page,
+        // loop mode needs to be disabled
+        if (pd->loop == EFL_UI_PAGER_LOOP_ENABLED)
+          {
+             _efl_ui_pager_loop_mode_set(obj, pd, EFL_UI_PAGER_LOOP_DISABLED);
+             _efl_ui_pager_loop_mode_set(obj, pd, EFL_UI_PAGER_LOOP_ENABLED);
+          }
+        efl_page_transition_update(pd->transition, pd->curr.pos);
+     }
    else
      {
         efl_pack_unpack(pd->page_box, subobj);

-- 


Reply via email to