[gimp] libgimpwidgets: tooltips no longer require an event box around no-window widgets



commit be3ebbb65c534a8f174ed8462cf565c681456102
Author: Michael Natterer <mitch gimp org>
Date:   Sun Oct 31 16:30:03 2010 +0100

    libgimpwidgets: tooltips no longer require an event box around no-window widgets

 libgimpwidgets/gimpscaleentry.c |   29 ++++-------------------------
 1 files changed, 4 insertions(+), 25 deletions(-)
---
diff --git a/libgimpwidgets/gimpscaleentry.c b/libgimpwidgets/gimpscaleentry.c
index b5c053d..83b543a 100644
--- a/libgimpwidgets/gimpscaleentry.c
+++ b/libgimpwidgets/gimpscaleentry.c
@@ -137,7 +137,6 @@ gimp_scale_entry_new_internal (gboolean     color_scale,
                                const gchar *help_id)
 {
   GtkWidget *label;
-  GtkWidget *ebox;
   GtkWidget *scale;
   GtkWidget *spinbutton;
   GtkObject *adjustment;
@@ -145,27 +144,9 @@ gimp_scale_entry_new_internal (gboolean     color_scale,
 
   label = gtk_label_new_with_mnemonic (text);
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-
-  if (tooltip)
-    {
-      ebox = g_object_new (GTK_TYPE_EVENT_BOX,
-                           "visible-window", FALSE,
-                           NULL);
-      gtk_table_attach (GTK_TABLE (table), ebox,
-                        column, column + 1, row, row + 1,
-                        GTK_FILL, GTK_FILL, 0, 0);
-      gtk_widget_show (ebox);
-
-      gtk_container_add (GTK_CONTAINER (ebox), label);
-    }
-  else
-    {
-      ebox = NULL;
-      gtk_table_attach (GTK_TABLE (table), label,
-                        column, column + 1, row, row + 1,
-                        GTK_FILL, GTK_FILL, 0, 0);
-    }
-
+  gtk_table_attach (GTK_TABLE (table), label,
+                    column, column + 1, row, row + 1,
+                    GTK_FILL, GTK_FILL, 0, 0);
   gtk_widget_show (label);
 
   if (! constrain &&
@@ -246,9 +227,7 @@ gimp_scale_entry_new_internal (gboolean     color_scale,
 
   if (tooltip || help_id)
     {
-      if (ebox)
-        gimp_help_set_help_data (ebox, tooltip, help_id);
-
+      gimp_help_set_help_data (label, tooltip, help_id);
       gimp_help_set_help_data (scale, tooltip, help_id);
       gimp_help_set_help_data (spinbutton, tooltip, help_id);
     }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]