elm scroller - also allow animator still to ALSO drive scroll for smoothing
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 22 Oct 2013 10:01:00 +0000 (11:01 +0100)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Tue, 22 Oct 2013 10:01:00 +0000 (11:01 +0100)
src/lib/elm_interface_scrollable.c
src/lib/elm_interface_scrollable.h

index 30f19d1..0a21041 100644 (file)
@@ -1449,6 +1449,7 @@ _elm_scroll_bounce_eval(Elm_Scrollable_Smart_Interface_Data *sid)
    if (sid->down.hold_active)
      {
         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);
@@ -1772,6 +1773,7 @@ _elm_scroll_content_region_show_internal(Evas_Object *obj,
    if (sid->down.hold_active)
      {
         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)
@@ -2587,6 +2589,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
         if (sid->down.hold_active)
           {
              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);
@@ -2672,6 +2675,7 @@ _elm_scroll_mouse_down_event_cb(void *data,
      }
    if (sid->down.hold_active)
      {
+        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)
@@ -2875,7 +2879,7 @@ _elm_scroll_hold_job(void *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;
 
@@ -2985,6 +2989,18 @@ _elm_scroll_hold_job(void *data)
 }
 
 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;
+}
+
+static Eina_Bool
 _elm_scroll_on_hold_animator(void *data)
 {
    double t, td;
@@ -3279,6 +3295,9 @@ _elm_scroll_mouse_move_event_cb(void *data,
 
              sid->down.hold_x = x;
              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 =
@@ -4579,6 +4598,7 @@ _elm_scroll_interface_del(Eo *obj, void *_pd, va_list *list EINA_UNUSED)
    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);
    if (sid->down.bounce_x_animator) ecore_animator_del(sid->down.bounce_x_animator);
index 5b03313..49865c1 100644 (file)
@@ -1120,6 +1120,7 @@ struct _Elm_Scrollable_Smart_Interface_Data
       int             hdir, vdir;
 
       Ecore_Job      *hold_job;
+      Ecore_Animator *hold_animator;
       Ecore_Animator *onhold_animator;
       Ecore_Animator *momentum_animator;
       Ecore_Animator *bounce_x_animator;