From 0ef946ed64c746aa210f40884d5e082e9c3a6d01 Mon Sep 17 00:00:00 2001 From: Kristian Rietveld Date: Tue, 6 Feb 2007 10:25:21 +0000 Subject: New tooltips API. 2007-02-06 Kristian Rietveld New tooltips API. * gtk/Makefile.am * gtk/gtk.h * gtk/gtk.symbols: build system foo. * gtk/gtkmain.c (gtk_main_do_event): call tooltip event handler hook for appropriate events. * gtk/gtkmarshalers.list: add BOOLEAN:INT,INT,BOOLEAN,OBJECT. * gtk/gtkrc.c: add style for gtk-tooltip. * gtk/gtksettings.c (gtk_settings_class_init): make the different tooltip timeouts configurable. * gtk/gtkwidget.[ch]: add new properties, signals, make sure tooltips are hidden on unmap, destroy, update window event mask on realize, hook into focus change and show help handlers. * gtk/gtkwindow.h: move GtkWindow typdef to gtkwidget.h ... * gtk/gtktooltip.[ch]: new files. * tests/Makefile.am * tests/testtooltips.c: add test application. svn path=/trunk/; revision=17264 --- gtk/gtksettings.c | 70 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) (limited to 'gtk/gtksettings.c') diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c index fb7858fbe5..8fdb459861 100644 --- a/gtk/gtksettings.c +++ b/gtk/gtksettings.c @@ -94,6 +94,9 @@ enum { PROP_COLOR_SCHEME, PROP_ENABLE_ANIMATIONS, PROP_TOUCHSCREEN_MODE, + PROP_TOOLTIP_TIMEOUT, + PROP_TOOLTIP_BROWSE_TIMEOUT, + PROP_TOOLTIP_BROWSE_MODE_TIMEOUT, PROP_KEYNAV_CURSOR_ONLY, PROP_KEYNAV_WRAP_AROUND, PROP_ERROR_BELL, @@ -556,6 +559,73 @@ gtk_settings_class_init (GtkSettingsClass *class) g_assert (result == PROP_TOUCHSCREEN_MODE); + /** + * GtkSettings:gtk-tooltip-timeout: + * + * Time, in milliseconds, after which a tooltip could appear if the + * cursor is hovering on top of a widget. + * + * Since: 2.12 + */ + result = settings_install_property_parser (class, + g_param_spec_int ("gtk-tooltip-timeout", + P_("Tooltip timeout"), + P_("Timeout before tooltip is shown"), + 0, G_MAXINT, + 1500, + GTK_PARAM_READWRITE), + NULL); + + g_assert (result == PROP_TOOLTIP_TIMEOUT); + + /** + * GtkSettings:gtk-tooltip-browse-timeout: + * + * Controls the time after which tooltips will appear when + * browse mode is enabled, in milliseconds. + * + * Browse mode is enabled when the mouse pointer moves off an object + * where a tooltip was currently being displayed. If the mouse pointer + * hits another object before the browse mode timeout expires (see + * gtk-tooltip-browse-mode-timeout), it will take the amount of + * milliseconds specified by this setting to popup the tooltip + * for the new object. + * + * Since: 2.12 + */ + result = settings_install_property_parser (class, + g_param_spec_int ("gtk-tooltip-browse-timeout", + P_("Tooltip browse timeout"), + P_("Timeout before tooltip is shown when browse mode is enabled"), + 0, G_MAXINT, + 100, + GTK_PARAM_READWRITE), + NULL); + + g_assert (result == PROP_TOOLTIP_BROWSE_TIMEOUT); + + /** + * GtkSettings:gtk-tooltip-browse-mode-timeout: + * + * Amount of time, in milliseconds, after which the browse mode + * will be disabled. + * + * See GtkSettings:gtk-tooltip-browse-timeout for more information + * about browse mode. + * + * Since: 2.12 + */ + result = settings_install_property_parser (class, + g_param_spec_int ("gtk-tooltip-browse-mode-timeout", + P_("Tooltip browse mode timeout"), + P_("Timeout after which browse mode is disabled"), + 0, G_MAXINT, + 500, + GTK_PARAM_READWRITE), + NULL); + + g_assert (result == PROP_TOOLTIP_BROWSE_MODE_TIMEOUT); + /** * GtkSettings:gtk-keynav-cursor-only: * -- cgit v1.2.1