+2009-02-16 Alejandro G. Castro <alex@igalia.com>
+
+ * src/hildon-pannable-area.c,
+ (hildon_pannable_area_class_init): Increased the maximum speed.
+ (hildon_pannable_area_get_property),
+ (hildon_pannable_area_set_property),
+ (hildon_pannable_area_timeout): Added a new low friction mode, it
+ allows the user avoid friction when launching the widget fast
+ enough. It is interesting to traverse long lists.
+
2009-02-16 Alberto Garcia <agarcia@igalia.com>
* src/hildon-stackable-window.c (hildon_stackable_window_class_init)
gint hovershoot_max;
gboolean initial_hint;
gboolean initial_effect;
+ gboolean low_friction_mode;
gboolean first_drag;
gboolean size_request_policy;
PROP_HOVERSHOOT_MAX,
PROP_SCROLL_TIME,
PROP_INITIAL_HINT,
+ PROP_LOW_FRICTION_MODE,
PROP_SIZE_REQUEST_POLICY,
PROP_HADJUSTMENT,
PROP_VADJUSTMENT,
"Maximum scroll velocity",
"Maximum distance the child widget should scroll "
"per 'frame', in pixels.",
- 0, G_MAXDOUBLE, 60,
+ 0, G_MAXDOUBLE, 96,
G_PARAM_READWRITE |
G_PARAM_CONSTRUCT));
G_PARAM_CONSTRUCT));
g_object_class_install_property (object_class,
+ PROP_LOW_FRICTION_MODE,
+ g_param_spec_boolean ("low-friction-mode",
+ "Do not decelerate the initial velocity",
+ "Avoid decelerating the panning movement, like no friction, the widget will stop in the edges or if the user clicks.",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT));
+
+ g_object_class_install_property (object_class,
PROP_SIZE_REQUEST_POLICY,
g_param_spec_enum ("size-request-policy",
"Size Requisition policy",
case PROP_INITIAL_HINT:
g_value_set_boolean (value, priv->initial_hint);
break;
+ case PROP_LOW_FRICTION_MODE:
+ g_value_set_boolean (value, priv->low_friction_mode);
+ break;
case PROP_SIZE_REQUEST_POLICY:
g_value_set_enum (value, priv->size_request_policy);
break;
case PROP_INITIAL_HINT:
priv->initial_hint = g_value_get_boolean (value);
break;
+ case PROP_LOW_FRICTION_MODE:
+ priv->low_friction_mode = g_value_get_boolean (value);
+ break;
case PROP_SIZE_REQUEST_POLICY:
hildon_pannable_area_set_size_request_policy (HILDON_PANNABLE_AREA (object),
g_value_get_enum (value));
}
} else {
- priv->vel_x *= priv->decel;
- priv->vel_y *= priv->decel;
+ if ((!priv->low_friction_mode) ||
+ ((priv->mov_mode&HILDON_MOVEMENT_MODE_HORIZ) &&
+ (ABS (priv->vel_x) < 0.8*priv->vmax)))
+ priv->vel_x *= priv->decel;
+
+ if ((!priv->low_friction_mode) ||
+ ((priv->mov_mode&HILDON_MOVEMENT_MODE_VERT) &&
+ (ABS (priv->vel_y) < 0.8*priv->vmax)))
+ priv->vel_y *= priv->decel;
if ((ABS (priv->vel_x) < 1.0) && (ABS (priv->vel_y) < 1.0)) {
priv->vel_x = 0;