From 99d8fa90d090507b760ea47988c627dae1d16dd1 Mon Sep 17 00:00:00 2001 From: Sven Neumann Date: Thu, 29 Dec 2005 01:33:38 +0000 Subject: [PATCH] allow to unset the tooltip by passing NULL. 2005-12-29 Sven Neumann * libgimpwidgets/gimphelpui.c (gimp_help_set_help_data): allow to unset the tooltip by passing NULL. * app/widgets/gimpdockseparator.c: unset the tooltip while the same text is being shown as a label. --- ChangeLog | 8 ++++++++ app/widgets/gimpdockseparator.c | 14 ++++++++++---- libgimpwidgets/gimphelpui.c | 6 +++--- 3 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4607f875de..10322d09e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2005-12-29 Sven Neumann + + * libgimpwidgets/gimphelpui.c (gimp_help_set_help_data): allow to + unset the tooltip by passing NULL. + + * app/widgets/gimpdockseparator.c: unset the tooltip while the same + text is being shown as a label. + 2005-12-29 Michael Natterer * libgimpbase/gimpbaseenums.[ch] (enum GimpPDBArgType): renamed diff --git a/app/widgets/gimpdockseparator.c b/app/widgets/gimpdockseparator.c index a53ac7e6ac..60db24ddc2 100644 --- a/app/widgets/gimpdockseparator.c +++ b/app/widgets/gimpdockseparator.c @@ -41,6 +41,8 @@ #define DEFAULT_HEIGHT 6 #define LABEL_PADDING 4 +#define HELP_TEXT _("You can drop dockable dialogs here.") + static void gimp_dock_separator_style_set (GtkWidget *widget, GtkStyle *prev_style); @@ -99,8 +101,7 @@ gimp_dock_separator_init (GimpDockSeparator *separator) gtk_widget_show (separator->frame); gimp_help_set_help_data (GTK_WIDGET (separator), - _("You can drop dockable dialogs here."), - GIMP_HELP_DOCK_SEPARATOR); + HELP_TEXT, GIMP_HELP_DOCK_SEPARATOR); gtk_drag_dest_set (GTK_WIDGET (separator), GTK_DEST_DEFAULT_ALL, @@ -273,8 +274,7 @@ gimp_dock_separator_set_show_label (GimpDockSeparator *separator, if (show && ! separator->label) { - separator->label = - gtk_label_new (_("You can drop dockable dialogs here.")); + separator->label = gtk_label_new (HELP_TEXT); gtk_misc_set_padding (GTK_MISC (separator->label), LABEL_PADDING, LABEL_PADDING); gtk_label_set_line_wrap (GTK_LABEL (separator->label), TRUE); @@ -284,10 +284,16 @@ gimp_dock_separator_set_show_label (GimpDockSeparator *separator, -1); gtk_container_add (GTK_CONTAINER (separator->frame), separator->label); gtk_widget_show (separator->label); + + gimp_help_set_help_data (GTK_WIDGET (separator), + NULL, GIMP_HELP_DOCK_SEPARATOR); } else if (! show && separator->label) { gtk_container_remove (GTK_CONTAINER (separator->frame), separator->label); separator->label = NULL; + + gimp_help_set_help_data (GTK_WIDGET (separator), + HELP_TEXT, GIMP_HELP_DOCK_SEPARATOR); } } diff --git a/libgimpwidgets/gimphelpui.c b/libgimpwidgets/gimphelpui.c index ddcc74173a..909330cd05 100644 --- a/libgimpwidgets/gimphelpui.c +++ b/libgimpwidgets/gimphelpui.c @@ -210,9 +210,9 @@ gimp_help_set_help_data (GtkWidget *widget, { g_return_if_fail (GTK_IS_WIDGET (widget)); - if (tooltip) - gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id); - else + gtk_tooltips_set_tip (tool_tips, widget, tooltip, help_id); + + if (! tooltip) g_object_set_qdata (G_OBJECT (widget), GIMP_HELP_ID, (gpointer) help_id); } -- GitLab