#define SCROLL_FADE_TIMEOUT 100
#define MOTION_EVENTS_PER_SECOND 25
#define CURSOR_STOPPED_TIMEOUT 80
+#define MAX_SPEED_THRESHOLD 250
#define PANNABLE_MAX_WIDTH 788
#define PANNABLE_MAX_HEIGHT 378
"Minimum scroll velocity",
"Minimum distance the child widget should scroll "
"per 'frame', in pixels per frame.",
- 0, G_MAXDOUBLE, 20,
+ 0, G_MAXDOUBLE, 10,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
"Threshold to consider a motion event an scroll",
"Amount of pixels to consider a motion event an scroll, if it is less"
"it is a click detected incorrectly by the touch screen.",
- 0, G_MAXUINT, 6,
+ 0, G_MAXUINT, 25,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
"Multiplier of the calculated speed",
"Force applied to the movement, multiplies the calculated speed of the"
"user movement the cursor in the screen",
- 0, G_MAXUINT, 120,
+ 0, G_MAXUINT, 50,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
priv->sps = g_value_get_uint (value);
break;
case PROP_PANNING_THRESHOLD:
- priv->panning_threshold = g_value_get_uint (value);
+ {
+ GtkSettings *settings = gtk_settings_get_default ();
+ GtkSettingsValue svalue = { NULL, { 0, }, };
+
+ priv->panning_threshold = g_value_get_uint (value);
+
+ /* insure gtk dnd is the same we are using, not allowed
+ different thresholds in the same application */
+ svalue.origin = "panning_threshold";
+ g_value_init (&svalue.value, G_TYPE_LONG);
+ g_value_set_long (&svalue.value, priv->panning_threshold);
+ gtk_settings_set_property_value (settings, "gtk-dnd-drag-threshold", &svalue);
+ g_value_unset (&svalue.value);
+ }
break;
case PROP_SCROLLBAR_FADE_DELAY:
/* convert to miliseconds */
HildonPannableAreaPrivate *priv = area->priv;
/* if moving do not fade out */
- if (((ABS (priv->vel_y)>1.0)||
- (ABS (priv->vel_x)>1.0))&&(!priv->button_pressed)) {
+ if (((ABS (priv->vel_y)>priv->vmin)||
+ (ABS (priv->vel_x)>priv->vmin))&&(!priv->button_pressed)) {
return TRUE;
}
}
}
- if ((ABS (priv->vel_y) > 1.0)||
- (ABS (priv->vel_x) > 1.0)) {
+ if ((ABS (priv->vel_y) > priv->vmin)||
+ (ABS (priv->vel_x) > priv->vmin)) {
priv->scroll_indicator_alpha = 1.0;
}
if ((ABS (priv->vel_y) >= priv->vmin) ||
(ABS (priv->vel_x) >= priv->vmin)) {
+ if (ABS (priv->vel_x) > MAX_SPEED_THRESHOLD)
+ priv->vel_x = (priv->vel_x > 0) ? priv->vmax : -priv->vmax;
+
+ if (ABS (priv->vel_y) > MAX_SPEED_THRESHOLD)
+ priv->vel_y = (priv->vel_y > 0) ? priv->vmax : -priv->vmax;
+
if (!priv->idle_id)
priv->idle_id = gdk_threads_add_timeout ((gint) (1000.0 / (gdouble) priv->sps),
(GSourceFunc)