settings: Add dnd-drag-threshold property

The newly added ClutterSettings:dnd-drag-threshold stores the
threshold, in pixels, that should be passed by the cursor to
start a drag operation.

http://bugzilla.clutter-project.org/show_bug.cgi?id=2583
This commit is contained in:
Emmanuele Bassi 2011-02-28 16:46:27 +00:00
parent 6d653fb6dd
commit b7685ad06b

View File

@ -49,6 +49,8 @@ struct _ClutterSettings
gint double_click_time;
gint double_click_distance;
gint dnd_drag_threshold;
gdouble resolution;
gchar *font_name;
@ -73,6 +75,8 @@ enum
PROP_DOUBLE_CLICK_TIME,
PROP_DOUBLE_CLICK_DISTANCE,
PROP_DND_DRAG_THRESHOLD,
PROP_FONT_NAME,
PROP_FONT_ANTIALIAS,
@ -210,6 +214,10 @@ clutter_settings_set_property (GObject *gobject,
self->double_click_distance = g_value_get_int (value);
break;
case PROP_DND_DRAG_THRESHOLD:
self->dnd_drag_threshold = g_value_get_int (value);
break;
case PROP_FONT_NAME:
g_free (self->font_name);
self->font_name = g_value_dup_string (value);
@ -267,6 +275,10 @@ clutter_settings_get_property (GObject *gobject,
g_value_set_int (value, self->double_click_distance);
break;
case PROP_DND_DRAG_THRESHOLD:
g_value_set_int (value, self->dnd_drag_threshold);
break;
case PROP_FONT_NAME:
g_value_set_string (value, self->font_name);
break;
@ -357,6 +369,22 @@ clutter_settings_class_init (ClutterSettingsClass *klass)
5,
CLUTTER_PARAM_READWRITE);
/**
* ClutterSettings:dnd-drag-threshold:
*
* The default distance that the cursor of a pointer device
* should travel before a drag operation should start.
*
* Since: 1.8
*/
obj_props[PROP_DND_DRAG_THRESHOLD] =
g_param_spec_int ("dnd-drag-threshold",
P_("Drag Threshold"),
P_("The distance the cursor should travel before starting to drag"),
1, G_MAXINT,
8,
CLUTTER_PARAM_READWRITE);
/**
* ClutterSettings:font-name:
*
@ -481,6 +509,8 @@ clutter_settings_init (ClutterSettings *self)
self->double_click_time = 250;
self->double_click_distance = 5;
self->dnd_drag_threshold = 8;
self->font_name = g_strdup (DEFAULT_FONT_NAME);
self->xft_antialias = -1;