Fixed problem with the timeout deceleration in pannable.
[hildon] / hildon / hildon-pannable-area.c
index 558fbb3..436fdb8 100644 (file)
@@ -57,7 +57,7 @@
 #define SCROLL_FADE_TIMEOUT 100
 #define MOTION_EVENTS_PER_SECOND 25
 #define CURSOR_STOPPED_TIMEOUT 200
-#define MAX_SPEED_THRESHOLD 250
+#define MAX_SPEED_THRESHOLD 290
 #define PANNABLE_MAX_WIDTH 788
 #define PANNABLE_MAX_HEIGHT 378
 
@@ -405,7 +405,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass)
                                                        "Maximum scroll velocity",
                                                        "Maximum distance the child widget should scroll "
                                                        "per 'frame', in pixels per frame.",
-                                                       0, G_MAXDOUBLE, 500,
+                                                       0, G_MAXDOUBLE, 3500,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
 
@@ -426,7 +426,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass)
                                                        "Minimum velocity that is considered 'fast': "
                                                        "children widgets won't receive button presses. "
                                                        "Expressed as a fraction of the maximum velocity.",
-                                                       0, 1, 0.02,
+                                                       0, 1, 0.01,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
 
@@ -436,7 +436,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass)
                                                        "Deceleration multiplier",
                                                        "The multiplier used when decelerating when in "
                                                        "acceleration scrolling mode.",
-                                                       0, 1.0, 0.93,
+                                                       0, 1.0, 0.85,
                                                        G_PARAM_READWRITE |
                                                        G_PARAM_CONSTRUCT));
 
@@ -476,7 +476,7 @@ hildon_pannable_area_class_init (HildonPannableAreaClass * klass)
                                                      "Time before starting to fade the scrollbar",
                                                      "Time the scrollbar is going to be visible if the widget is not in"
                                                       "action in miliseconds",
-                                                     0, G_MAXUINT, 3000,
+                                                     0, G_MAXUINT, 1000,
                                                      G_PARAM_READWRITE |
                                                      G_PARAM_CONSTRUCT));
 
@@ -2314,6 +2314,10 @@ hildon_pannable_area_timeout (HildonPannableArea * area)
     return FALSE;
   }
 
+  hildon_pannable_area_scroll (area, priv->vel_x, priv->vel_y);
+
+  gdk_window_process_updates (GTK_WIDGET (area)->window, FALSE);
+
   if (!priv->button_pressed) {
     /* Decelerate gradually when pointer is raised */
     if ((!priv->overshot_dist_y) &&
@@ -2358,10 +2362,6 @@ hildon_pannable_area_timeout (HildonPannableArea * area)
     return FALSE;
   }
 
-  hildon_pannable_area_scroll (area, priv->vel_x, priv->vel_y);
-
-  gdk_window_process_updates (GTK_WIDGET (area)->window, FALSE);
-
   return TRUE;
 }
 
@@ -2758,9 +2758,11 @@ hildon_pannable_area_button_release_cb (GtkWidget * widget,
   priv->button_pressed = FALSE;
 
   /* if widget was moving fast in the panning, increase speed even more */
-  if ((event->time - priv->last_press_time < 200) &&
+  if ((event->time - priv->last_press_time < 125) &&
       ((ABS (priv->old_vel_x) > priv->vmin) ||
-       (ABS (priv->old_vel_y) > priv->vmin)))
+       (ABS (priv->old_vel_y) > priv->vmin)) &&
+      ((ABS (priv->old_vel_x) > 40) ||
+       (ABS (priv->old_vel_y) > 40)))
     {
       gint symbol = 0;
 
@@ -3057,7 +3059,7 @@ hildon_pannable_calculate_vel_factor (HildonPannableArea * self)
     fct += fct_i;
   }
 
-    priv->vel_factor = fct;
+  priv->vel_factor = fct;
 }
 
 /**