From: Jaeun Choi Date: Wed, 23 Jan 2019 12:17:29 +0000 (+0900) Subject: efl_ui_pager: set current page as -1 when pager is empty X-Git-Tag: accepted/tizen/unified/20190201.061426~106 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=fb56ae269d7ee58dcdb8e850e74ea1c724d7f86a;p=platform%2Fupstream%2Fefl.git efl_ui_pager: set current page as -1 when pager is empty it makes more sense that the current page number is -1 when pager is empty since numbering starts from 0 when pager actually contains pages. this patch also fixes a bug in pack_begin function, in which the current page is increased by 1. --- diff --git a/src/lib/elementary/efl_ui_pager.c b/src/lib/elementary/efl_ui_pager.c index 4b84ea7..e0e3313 100644 --- a/src/lib/elementary/efl_ui_pager.c +++ b/src/lib/elementary/efl_ui_pager.c @@ -339,7 +339,7 @@ _efl_ui_pager_efl_object_constructor(Eo *obj, pd->cnt = 0; pd->loop = EFL_UI_PAGER_LOOP_DISABLED; - pd->curr.page = 0; + pd->curr.page = -1; pd->curr.pos = 0.0; pd->transition = NULL; @@ -424,6 +424,7 @@ _efl_ui_pager_efl_pack_linear_pack_end(Eo *obj EINA_UNUSED, pd->content_list = eina_list_append(pd->content_list, subobj); pd->cnt++; + if (pd->curr.page == -1) pd->curr.page = 0; if (pd->transition) efl_page_transition_update(pd->transition, pd->curr.pos);