From 8dab5200ea459a9585f55c830e281ab2963131bb Mon Sep 17 00:00:00 2001 From: "Carsten Haitzler (Rasterman)" Date: Fri, 25 Oct 2013 03:59:55 +0100 Subject: [PATCH] Revert "elm scroller - also allow animator still to ALSO drive scroll for smoothing" This reverts commit e52ddca9b0d424c5e1dfeeec501f4a95544e3dbb. This reverts commit 7a7ea7d61e8a321dcd2046d07a0473e57a87d8b2. --- .../elementary/src/lib/elm_interface_scrollable.c | 41 +++++----------------- .../elementary/src/lib/elm_interface_scrollable.h | 2 -- 2 files changed, 8 insertions(+), 35 deletions(-) diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.c b/legacy/elementary/src/lib/elm_interface_scrollable.c index 0a21041..5441bdb 100644 --- a/legacy/elementary/src/lib/elm_interface_scrollable.c +++ b/legacy/elementary/src/lib/elm_interface_scrollable.c @@ -1446,11 +1446,9 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid) if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); } - if (sid->down.hold_active) + if (sid->down.hold_animator) { - sid->down.hold_active = EINA_FALSE; ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del); - ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del); if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); } @@ -1770,11 +1768,9 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj, if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); } - if (sid->down.hold_active) + if (sid->down.hold_animator) { - sid->down.hold_active = EINA_FALSE; ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del); - ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del); _elm_scroll_drag_stop(sid); if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); @@ -1883,7 +1879,7 @@ _elm_scroll_wanted_region_set(Evas_Object *obj) if (sid->down.now || sid->down.momentum_animator || sid->down.bounce_x_animator || sid->down.bounce_y_animator || - sid->down.hold_active || sid->down.onhold_animator || + sid->down.hold_animator || sid->down.onhold_animator || sid->scrollto.x.animator || sid->scrollto.y.animator) return; @@ -2586,11 +2582,9 @@ _elm_scroll_mouse_up_event_cb(void *data, } } } - if (sid->down.hold_active) + if (sid->down.hold_animator) { - sid->down.hold_active = EINA_FALSE; ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del); - ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del); if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); } @@ -2673,10 +2667,9 @@ _elm_scroll_mouse_down_event_cb(void *data, if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); } - if (sid->down.hold_active) + if (sid->down.hold_animator) { ELM_SAFE_FREE(sid->down.hold_animator, ecore_animator_del); - ELM_SAFE_FREE(sid->down.hold_job, ecore_job_del); _elm_scroll_drag_stop(sid); if (sid->content_info.resized) _elm_scroll_wanted_region_set(sid->obj); @@ -2872,14 +2865,12 @@ _elm_scroll_down_coord_eval(Elm_Scrollable_Smart_Interface_Data *sid, _elm_config->thumbscroll_border_friction; } -static void -_elm_scroll_hold_job(void *data) +static Eina_Bool +_elm_scroll_hold_animator(void *data) { Elm_Scrollable_Smart_Interface_Data *sid = data; Evas_Coord ox = 0, oy = 0, fx = 0, fy = 0; - sid->down.hold_active = EINA_FALSE; - fx = sid->down.hold_x; fy = sid->down.hold_y; @@ -2986,17 +2977,7 @@ _elm_scroll_hold_job(void *data) #endif eo_do(sid->obj, elm_scrollable_interface_content_pos_set(ox, oy, EINA_TRUE)); -} -static Eina_Bool -_elm_scroll_hold_animator(void *data) -{ - Elm_Scrollable_Smart_Interface_Data *sid = data; - - if (!sid->down.hold_job) - ecore_job_del(sid->down.hold_job); - sid->down.hold_job = - ecore_job_add(_elm_scroll_hold_job, sid); return ECORE_CALLBACK_RENEW; } @@ -3297,12 +3278,7 @@ _elm_scroll_mouse_move_event_cb(void *data, sid->down.hold_y = y; if (!sid->down.hold_animator) sid->down.hold_animator = - ecore_animator_add(_elm_scroll_hold_animator, sid); - if (!sid->down.hold_job) - ecore_job_del(sid->down.hold_job); - sid->down.hold_job = - ecore_job_add(_elm_scroll_hold_job, sid); - sid->down.hold_active = EINA_TRUE; + ecore_animator_add(_elm_scroll_hold_animator, sid); } else { @@ -4597,7 +4573,6 @@ _elm_scroll_interface_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED) eo_do(obj, elm_scrollable_interface_content_set(NULL)); if (!sid->extern_pan) evas_object_del(sid->pan_obj); - if (sid->down.hold_job) ecore_job_del(sid->down.hold_job); if (sid->down.hold_animator) ecore_animator_del(sid->down.hold_animator); if (sid->down.onhold_animator) ecore_animator_del(sid->down.onhold_animator); if (sid->down.momentum_animator) ecore_animator_del(sid->down.momentum_animator); diff --git a/legacy/elementary/src/lib/elm_interface_scrollable.h b/legacy/elementary/src/lib/elm_interface_scrollable.h index 49865c1..98fa9b5 100644 --- a/legacy/elementary/src/lib/elm_interface_scrollable.h +++ b/legacy/elementary/src/lib/elm_interface_scrollable.h @@ -1119,7 +1119,6 @@ struct _Elm_Scrollable_Smart_Interface_Data Evas_Coord locked_x, locked_y; int hdir, vdir; - Ecore_Job *hold_job; Ecore_Animator *hold_animator; Ecore_Animator *onhold_animator; Ecore_Animator *momentum_animator; @@ -1140,7 +1139,6 @@ struct _Elm_Scrollable_Smart_Interface_Data Eina_Bool dir_y : 1; Eina_Bool hold : 1; Eina_Bool now : 1; - Eina_Bool hold_active : 1; } down; struct -- 2.7.4