diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2006-09-01 02:14:30 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2006-09-01 02:14:30 +0000 |
commit | 5b0de8d59714f64f4e422eaeb4dddf1ab7d293cc (patch) | |
tree | f0d4f2d19ac0af87064b508f5a6a1429b19a0ec0 /gtk/gtksettings.c | |
parent | eda5e5c413bff1e6f6d9bd2a2fd556c7c1905682 (diff) | |
download | gtk+-5b0de8d59714f64f4e422eaeb4dddf1ab7d293cc.tar.gz |
Stop cursor blinking after a configurable timeout. (#353670, #352442,
Stop cursor blinking after a configurable timeout.
(#353670, #352442, Arjan van de Ven, Manu Cornet)
* gtk/gtksettings.c (gtk_settings_class_init): Add a
gtk-cursor-blink-timeout setting, which specifies the number
of seconds that the cursor should blink after a user interaction.
The default value is G_MAXINT to preserve the current behaviour.
* gtk/gtkentry.c (blink_cb): Stop blinking after blink-timeout
seconds.
* gtk/gtkentry.c (gtk_entry_completion_key_press)
(gtk_entry_button_press, gtk_entry_focus_in): Reset the
blink timer.
* gtk/gtktextview.c (blink_cb): Stop blinking after blink-timeout
seconds.
* gtk/gtktextview.c (gtk_text_view_key_press_event)
(gtk_text_view_button_press_event, gtk_text_view_focus_in_event):
Reset the blink timer.
Diffstat (limited to 'gtk/gtksettings.c')
-rw-r--r-- | gtk/gtksettings.c | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index ad93c671e5..9b9bb51742 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -64,6 +64,7 @@ enum { PROP_DOUBLE_CLICK_DISTANCE, PROP_CURSOR_BLINK, PROP_CURSOR_BLINK_TIME, + PROP_CURSOR_BLINK_TIMEOUT, PROP_SPLIT_CURSOR, PROP_THEME_NAME, PROP_ICON_THEME_NAME, @@ -201,6 +202,15 @@ gtk_settings_class_init (GtkSettingsClass *class) GTK_PARAM_READWRITE), NULL); g_assert (result == PROP_DOUBLE_CLICK_DISTANCE); + + /** + * GtkSettings:gtk-cursor-blink: + * + * Whether the cursor should blink. + * + * Also see the gtk-cursor-blink-timeout setting, which allows + * more flexible control over cursor blinking. + */ result = settings_install_property_parser (class, g_param_spec_boolean ("gtk-cursor-blink", P_("Cursor Blink"), @@ -212,11 +222,31 @@ gtk_settings_class_init (GtkSettingsClass *class) result = settings_install_property_parser (class, g_param_spec_int ("gtk-cursor-blink-time", P_("Cursor Blink Time"), - P_("Length of the cursor blink cycle, in milleseconds"), + P_("Length of the cursor blink cycle, in milliseconds"), 100, G_MAXINT, 1200, GTK_PARAM_READWRITE), NULL); g_assert (result == PROP_CURSOR_BLINK_TIME); + + /** + * GtkSettings:gtk-cursor-blink-timeout: + * + * Time after which the cursor stops blinking, in seconds. + * The timer is reset after each user interaction. + * + * Setting this to zero has the same effect as setting + * gtk-cursor-blinks to %FALSE. + * + * Since: 2.12 + */ + result = settings_install_property_parser (class, + g_param_spec_int ("gtk-cursor-blink-timeout", + P_("Cursor Blink Timeout"), + P_("Time after which the cursor stops blinking, in seconds"), + 1, G_MAXINT, G_MAXINT, + GTK_PARAM_READWRITE), + NULL); + g_assert (result == PROP_CURSOR_BLINK_TIMEOUT); result = settings_install_property_parser (class, g_param_spec_boolean ("gtk-split-cursor", P_("Split Cursor"), |