Scroller decides whether the accelerator is on or not, depending on the velocity...
authorJaehwan Kim <jae.hwan.kim@samsung.com>
Mon, 1 Apr 2013 05:02:23 +0000 (14:02 +0900)
committerJaehwan Kim <jae.hwan.kim@samsung.com>
Mon, 1 Apr 2013 05:05:51 +0000 (14:05 +0900)
ChangeLog
NEWS
src/lib/elm_interface_scrollable.c

index 9e2c00e..12e8ec8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
 2013-03-29  Mike Blumenkrantz
 
         * Fix ctxpopup geometry when parent is an elm_win.
+
+2013-04-01  Jaehwan Kim
+
+        * Scroller decides whether the accelerator is on or not, depending on the velocity and the interval time of the flick event.
diff --git a/NEWS b/NEWS
index 0687d33..0eec980 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -90,6 +90,7 @@ Improvements:
    * Improve gengrid item append performance.
    * Naviframe works for H/W Back key event.
    * Naviframe is now supproting focus_direction.
+   * Scroller decides whether the accelerator is on or not, depending on the velocity and the interval time of the flick event.
 
 Fixes:
 
index f49e209..e64bd2b 100644 (file)
@@ -2280,6 +2280,7 @@ _elm_scroll_mouse_up_event_cb(void *data,
                            (vel > _elm_config->thumbscroll_momentum_threshold))
                          {
                             int minx, miny, mx, my, px, py;
+                            double tt = 0.0, dtt = 0.0;
 
                             eo_do(sid->pan_obj, elm_obj_pan_pos_min_get
                                   (&minx, &miny));
@@ -2289,22 +2290,12 @@ _elm_scroll_mouse_up_event_cb(void *data,
                             sid->down.dx = ((double)dx / at);
                             sid->down.dy = ((double)dy / at);
                             if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
-                                ((sid->down.dx < 0) && (sid->down.pdx < 0)))
-                              if (px > minx && px < mx)
-                                sid->down.dx += (double)sid->down.pdx * 1.5;
-                            // FIXME: * 1.5 - probably should be config
-                            if (((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
-                                ((sid->down.dy < 0) && (sid->down.pdy < 0)))
-                              if (py > miny && py < my)
-                                sid->down.dy += (double)sid->down.pdy * 1.5;
-                            // FIXME: * 1.5 - probably should be config
-                            if (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
                                 ((sid->down.dx < 0) && (sid->down.pdx < 0)) ||
                                 ((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
                                 ((sid->down.dy < 0) && (sid->down.pdy < 0)))
                               {
-                                 double tt = ecore_loop_time_get();
-                                 double dtt = tt - sid->down.anim_start;
+                                 tt = ecore_loop_time_get();
+                                 dtt = tt - sid->down.anim_start;
 
                                  if (dtt < 0.0) dtt = 0.0;
                                  else if (dtt >
@@ -2315,6 +2306,19 @@ _elm_scroll_mouse_up_event_cb(void *data,
                               }
                             else
                               sid->down.extra_time = 0.0;
+
+                            if (abs(sid->down.dx) > 500 && (dtt < 0.7) &&
+                                (((sid->down.dx > 0) && (sid->down.pdx > 0)) ||
+                                ((sid->down.dx < 0) && (sid->down.pdx < 0))))
+                              if (px > minx && px < mx)
+                                sid->down.dx += (double)sid->down.pdx * 2.5;
+                            // FIXME: > 500, < 0.7, * 1.5 - probably should be config
+                            if (abs(sid->down.dy) > 500 && (dtt < 0.7) &&
+                                (((sid->down.dy > 0) && (sid->down.pdy > 0)) ||
+                                ((sid->down.dy < 0) && (sid->down.pdy < 0))))
+                              if (py > miny && py < my)
+                                sid->down.dy += (double)sid->down.pdy * 2.5;
+                            // FIXME: > 500, < 0.7, * 1.5 - probably should be config
                             sid->down.pdx = sid->down.dx;
                             sid->down.pdy = sid->down.dy;
                             ox = -sid->down.dx;