Deprecate and hardcode values for gtk-tooltip* timeouts

This commit is contained in:
William Jon McCann 2013-07-08 13:13:23 -04:00
parent c9bfd12d2f
commit e61c124509
4 changed files with 14 additions and 15 deletions

View File

@ -773,6 +773,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
* cursor is hovering on top of a widget. * cursor is hovering on top of a widget.
* *
* Since: 2.12 * Since: 2.12
*
* Deprecated: 3.10: This setting is ignored.
*/ */
result = settings_install_property_parser (class, result = settings_install_property_parser (class,
g_param_spec_int ("gtk-tooltip-timeout", g_param_spec_int ("gtk-tooltip-timeout",
@ -799,6 +801,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
* for the new object. * for the new object.
* *
* Since: 2.12 * Since: 2.12
*
* Deprecated: 3.10: This setting is ignored.
*/ */
result = settings_install_property_parser (class, result = settings_install_property_parser (class,
g_param_spec_int ("gtk-tooltip-browse-timeout", g_param_spec_int ("gtk-tooltip-browse-timeout",
@ -821,6 +825,8 @@ gtk_settings_class_init (GtkSettingsClass *class)
* about browse mode. * about browse mode.
* *
* Since: 2.12 * Since: 2.12
*
* Deprecated: 3.10: This setting is ignored.
*/ */
result = settings_install_property_parser (class, result = settings_install_property_parser (class,
g_param_spec_int ("gtk-tooltip-browse-mode-timeout", g_param_spec_int ("gtk-tooltip-browse-mode-timeout",

View File

@ -605,7 +605,7 @@ gtk_status_icon_class_init (GtkStatusIconClass *class)
* @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard
* @tooltip: a #GtkTooltip * @tooltip: a #GtkTooltip
* *
* Emitted when the #GtkSettings:gtk-tooltip-timeout has expired with the * Emitted when the hover timeout has expired with the
* cursor hovering above @status_icon; or emitted when @status_icon got * cursor hovering above @status_icon; or emitted when @status_icon got
* focus in keyboard mode. * focus in keyboard mode.
* *

View File

@ -109,6 +109,9 @@
#undef DEBUG_TOOLTIP #undef DEBUG_TOOLTIP
#define HOVER_TIMEOUT 500
#define BROWSE_TIMEOUT 60
#define BROWSE_DISABLE_TIMEOUT 500
#define GTK_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIP, GtkTooltipClass)) #define GTK_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_TOOLTIP, GtkTooltipClass))
#define GTK_IS_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIP)) #define GTK_IS_TOOLTIP_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_TOOLTIP))
@ -1351,14 +1354,7 @@ gtk_tooltip_hide_tooltip (GtkTooltip *tooltip)
if (!tooltip->keyboard_mode_enabled) if (!tooltip->keyboard_mode_enabled)
{ {
guint timeout; guint timeout = BROWSE_DISABLE_TIMEOUT;
GtkSettings *settings;
settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window));
g_object_get (settings,
"gtk-tooltip-browse-mode-timeout", &timeout,
NULL);
/* The tooltip is gone, after (by default, should be configurable) 500ms /* The tooltip is gone, after (by default, should be configurable) 500ms
* we want to turn off browse mode * we want to turn off browse mode
@ -1414,7 +1410,6 @@ gtk_tooltip_start_delay (GdkDisplay *display)
{ {
guint timeout; guint timeout;
GtkTooltip *tooltip; GtkTooltip *tooltip;
GtkSettings *settings;
tooltip = g_object_get_data (G_OBJECT (display), tooltip = g_object_get_data (G_OBJECT (display),
"gdk-display-current-tooltip"); "gdk-display-current-tooltip");
@ -1425,12 +1420,10 @@ gtk_tooltip_start_delay (GdkDisplay *display)
if (tooltip->timeout_id) if (tooltip->timeout_id)
g_source_remove (tooltip->timeout_id); g_source_remove (tooltip->timeout_id);
settings = gtk_widget_get_settings (GTK_WIDGET (tooltip->window));
if (tooltip->browse_mode_enabled) if (tooltip->browse_mode_enabled)
g_object_get (settings, "gtk-tooltip-browse-timeout", &timeout, NULL); timeout = BROWSE_TIMEOUT;
else else
g_object_get (settings, "gtk-tooltip-timeout", &timeout, NULL); timeout = HOVER_TIMEOUT;
tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout, tooltip->timeout_id = gdk_threads_add_timeout_full (0, timeout,
tooltip_popup_timeout, tooltip_popup_timeout,

View File

@ -3237,7 +3237,7 @@ G_GNUC_END_IGNORE_DEPRECATIONS
* @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard * @keyboard_mode: %TRUE if the tooltip was trigged using the keyboard
* @tooltip: a #GtkTooltip * @tooltip: a #GtkTooltip
* *
* Emitted when #GtkWidget:has-tooltip is %TRUE and the #GtkSettings:gtk-tooltip-timeout * Emitted when #GtkWidget:has-tooltip is %TRUE and the hover timeout
* has expired with the cursor hovering "above" @widget; or emitted when @widget got * has expired with the cursor hovering "above" @widget; or emitted when @widget got
* focus in keyboard mode. * focus in keyboard mode.
* *