summaryrefslogtreecommitdiff
path: root/src/lib/elementary/efl_page_indicator_icon.c
diff options
context:
space:
mode:
authorJaeun Choi <jaeun12.choi@samsung.com>2019-01-25 13:37:29 +0900
committerJaeun Choi <jaeun12.choi@samsung.com>2019-01-25 14:26:12 +0900
commit719b129dde91532d07211735de8c48c0d38c7e4f (patch)
treec3178024b29771875d036609a5a63b8812cf4ead /src/lib/elementary/efl_page_indicator_icon.c
parent08fa28f34143093d56c1db99a10647d3eb18b032 (diff)
efl_page_indicator_icon: refactor update function
Diffstat (limited to '')
-rw-r--r--src/lib/elementary/efl_page_indicator_icon.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/elementary/efl_page_indicator_icon.c b/src/lib/elementary/efl_page_indicator_icon.c
index aa87ec6422..7ec69a8237 100644
--- a/src/lib/elementary/efl_page_indicator_icon.c
+++ b/src/lib/elementary/efl_page_indicator_icon.c
@@ -19,8 +19,6 @@ _efl_page_indicator_icon_update(Eo *obj,
19 double pos) 19 double pos)
20{ 20{
21 EFL_PAGE_INDICATOR_DATA_GET(obj, spd); 21 EFL_PAGE_INDICATOR_DATA_GET(obj, spd);
22 Eo *item;
23 int page = efl_ui_pager_current_page_get(spd->pager.obj);
24 double delta = fabs(pos); 22 double delta = fabs(pos);
25 23
26 if (pd->curr) 24 if (pd->curr)
@@ -30,19 +28,19 @@ _efl_page_indicator_icon_update(Eo *obj,
30 if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v)); 28 if (pd->adj) efl_layout_signal_message_send(pd->adj, 1, *(pd->v));
31 } 29 }
32 30
33 item = eina_list_nth(pd->items, page); 31 efl_page_indicator_update(efl_super(obj, MY_CLASS), pos);
32
33 pd->curr = eina_list_nth(pd->items, spd->curr_idx);
34 eina_value_set(pd->v, (1.0 - delta)); 34 eina_value_set(pd->v, (1.0 - delta));
35 efl_layout_signal_message_send(item, 1, *(pd->v)); 35 efl_layout_signal_message_send(pd->curr, 1, *(pd->v));
36 pd->curr = item;
37 36
38 if (pos < 0) 37 if (pos < 0)
39 item = eina_list_nth(pd->items, (page - 1 + spd->cnt) % spd->cnt); 38 pd->adj = eina_list_nth(pd->items, (spd->curr_idx - 1 + spd->cnt) % spd->cnt);
40 else 39 else
41 item = eina_list_nth(pd->items, (page + 1 + spd->cnt) % spd->cnt); 40 pd->adj = eina_list_nth(pd->items, (spd->curr_idx + 1 + spd->cnt) % spd->cnt);
42 41
43 eina_value_set(pd->v, delta); 42 eina_value_set(pd->v, delta);
44 efl_layout_signal_message_send(item, 1, *(pd->v)); 43 efl_layout_signal_message_send(pd->adj, 1, *(pd->v));
45 pd->adj = item;
46} 44}
47 45
48EOLIAN static void 46EOLIAN static void