summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2015-11-03 12:29:05 -0800
committerCedric BAIL <cedric@osg.samsung.com>2015-11-04 16:23:32 -0800
commit5cfe1cff12645a94a9fd529f560125e1716d213a (patch)
tree47312d0ea4799160f1db1c52f68fa6bd7e8cf893
parent59af6da2ccaa3fd06df78a78e0166a135f81b20d (diff)
interface_scrollable: delete unnecessary smart callback call.
Summary: When _elm_interface_scrollable_page_bring_in is called, page is not changed yet. So "page,changed" smart callback is unnecessary. Sometimes "page,changed" smart callback is called twice. Because "drag,stop" and "anim,stop"is called it. So I add updating current page code. Test Plan: elementary_test -> scroller 1. using wheel. 2. using "prev page" and "next page". 3. draging sceen Reviewers: Hermet, singh.amitesh, cedric, raster, jaehwan, seoz Differential Revision: https://phab.enlightenment.org/D3260 Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
-rw-r--r--src/lib/elm_interface_scrollable.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/lib/elm_interface_scrollable.c b/src/lib/elm_interface_scrollable.c
index 23d0ebba1..ab2db6329 100644
--- a/src/lib/elm_interface_scrollable.c
+++ b/src/lib/elm_interface_scrollable.c
@@ -939,6 +939,8 @@ _elm_scroll_drag_stop(Elm_Scrollable_Smart_Interface_Data *sid)
939 if (sid->cb_func.page_change && 939 if (sid->cb_func.page_change &&
940 ((x != sid->current_page.x) || (y != sid->current_page.y))) 940 ((x != sid->current_page.x) || (y != sid->current_page.y)))
941 sid->cb_func.page_change(sid->obj, NULL); 941 sid->cb_func.page_change(sid->obj, NULL);
942 sid->current_page.x = x;
943 sid->current_page.y = y;
942 } 944 }
943 945
944 if (sid->cb_func.drag_stop) 946 if (sid->cb_func.drag_stop)
@@ -948,6 +950,9 @@ _elm_scroll_drag_stop(Elm_Scrollable_Smart_Interface_Data *sid)
948static void 950static void
949_elm_scroll_anim_start(Elm_Scrollable_Smart_Interface_Data *sid) 951_elm_scroll_anim_start(Elm_Scrollable_Smart_Interface_Data *sid)
950{ 952{
953 sid->current_page.x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
954 sid->current_page.y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
955
951 if (sid->cb_func.animate_start) 956 if (sid->cb_func.animate_start)
952 sid->cb_func.animate_start(sid->obj, NULL); 957 sid->cb_func.animate_start(sid->obj, NULL);
953} 958}
@@ -963,6 +968,8 @@ _elm_scroll_anim_stop(Elm_Scrollable_Smart_Interface_Data *sid)
963 y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE); 968 y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
964 if ((x != sid->current_page.x) || (y != sid->current_page.y)) 969 if ((x != sid->current_page.x) || (y != sid->current_page.y))
965 sid->cb_func.page_change(sid->obj, NULL); 970 sid->cb_func.page_change(sid->obj, NULL);
971 sid->current_page.x = x;
972 sid->current_page.y = y;
966 } 973 }
967 974
968 if (sid->cb_func.animate_stop) 975 if (sid->cb_func.animate_stop)
@@ -4395,9 +4402,6 @@ _elm_interface_scrollable_page_bring_in(Eo *obj, Elm_Scrollable_Smart_Interface_
4395 Evas_Coord x = 0; 4402 Evas_Coord x = 0;
4396 Evas_Coord y = 0; 4403 Evas_Coord y = 0;
4397 4404
4398 sid->current_page.x = _elm_scroll_page_x_get(sid, 0, EINA_FALSE);
4399 sid->current_page.y = _elm_scroll_page_y_get(sid, 0, EINA_FALSE);
4400
4401 eo_do(sid->obj, elm_interface_scrollable_content_viewport_geometry_get 4405 eo_do(sid->obj, elm_interface_scrollable_content_viewport_geometry_get
4402 (NULL, NULL, &w, &h)); 4406 (NULL, NULL, &w, &h));
4403 x = sid->pagesize_h * pagenumber_h; 4407 x = sid->pagesize_h * pagenumber_h;
@@ -4407,12 +4411,6 @@ _elm_interface_scrollable_page_bring_in(Eo *obj, Elm_Scrollable_Smart_Interface_
4407 _elm_scroll_scroll_to_x(sid, _elm_config->bring_in_scroll_friction, x); 4411 _elm_scroll_scroll_to_x(sid, _elm_config->bring_in_scroll_friction, x);
4408 _elm_scroll_scroll_to_y(sid, _elm_config->bring_in_scroll_friction, y); 4412 _elm_scroll_scroll_to_y(sid, _elm_config->bring_in_scroll_friction, y);
4409 } 4413 }
4410
4411 if ((sid->current_page.x != x) || (sid->current_page.y != y))
4412 {
4413 if (sid->cb_func.page_change)
4414 sid->cb_func.page_change(sid->obj, NULL);
4415 }
4416} 4414}
4417 4415
4418EOLIAN static void 4416EOLIAN static void