]> Pileus Git - ~andy/gtk/commitdiff
Jump through a few hoops to make the tooltip on the filter combo box work
authorMatthias Clasen <mclasen@redhat.com>
Sun, 7 Nov 2004 04:10:01 +0000 (04:10 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Sun, 7 Nov 2004 04:10:01 +0000 (04:10 +0000)
2004-11-06  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
a few hoops to make the tooltip on the filter combo box work
a bit better. This fixes #157273 and #157074.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkcombobox.c
gtk/gtkfilechooserdefault.c

index e26f73c01477356ec51467d8ed880c6ef2241e67..d6af84867d321b7aa5dd162e9a37163f0fdf4968 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
+       a few hoops to make the tooltip on the filter combo box work
+       a bit better. This fixes #157273 and #157074.
+
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_pack_end): 
        Add the ComboCellInfo to the list.  (#157528, Carlos Garnacho
        Parro)
index e26f73c01477356ec51467d8ed880c6ef2241e67..d6af84867d321b7aa5dd162e9a37163f0fdf4968 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
+       a few hoops to make the tooltip on the filter combo box work
+       a bit better. This fixes #157273 and #157074.
+
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_pack_end): 
        Add the ComboCellInfo to the list.  (#157528, Carlos Garnacho
        Parro)
index e26f73c01477356ec51467d8ed880c6ef2241e67..d6af84867d321b7aa5dd162e9a37163f0fdf4968 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
+       a few hoops to make the tooltip on the filter combo box work
+       a bit better. This fixes #157273 and #157074.
+
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_pack_end): 
        Add the ComboCellInfo to the list.  (#157528, Carlos Garnacho
        Parro)
index e26f73c01477356ec51467d8ed880c6ef2241e67..d6af84867d321b7aa5dd162e9a37163f0fdf4968 100644 (file)
@@ -1,5 +1,9 @@
 2004-11-06  Matthias Clasen  <mclasen@redhat.com>
 
+       * gtk/gtkfilechooserdefault.c (file_pane_create): Jump through
+       a few hoops to make the tooltip on the filter combo box work
+       a bit better. This fixes #157273 and #157074.
+
        * gtk/gtkcombobox.c (gtk_combo_box_cell_layout_pack_end): 
        Add the ComboCellInfo to the list.  (#157528, Carlos Garnacho
        Parro)
index a2442045915636e7568309526407f3cf4ffc3313..9a4976a24aa15963df5444b27be410db6a167efc 100644 (file)
@@ -2260,6 +2260,7 @@ gtk_combo_box_menu_setup (GtkComboBox *combo_box,
   if (combo_box->priv->cell_view)
     {
       combo_box->priv->button = gtk_toggle_button_new ();
+
       g_signal_connect (combo_box->priv->button, "toggled",
                         G_CALLBACK (gtk_combo_box_button_toggled), combo_box);
       g_signal_connect_after (combo_box->priv->button, 
index 71bb4909f8bdf4d185a175bb22244f095414ca3e..21432a6e4fc97000484024f98adae42fbe743caa 100644 (file)
@@ -3135,6 +3135,29 @@ create_path_bar (GtkFileChooserDefault *impl)
   return path_bar;
 }
 
+static void
+set_filter_tooltip (GtkWidget *widget, 
+                   gpointer   data)
+{
+  GtkTooltips *tooltips = (GtkTooltips *)data;
+
+  if (GTK_IS_BUTTON (widget))
+    gtk_tooltips_set_tip (tooltips, widget,
+                         _("Select which types of files are shown"), 
+                         NULL);
+}
+
+static void
+realize_filter_combo (GtkWidget *combo,
+                     gpointer   data)
+{
+  GtkFileChooserDefault *impl = (GtkFileChooserDefault *)data;
+
+  gtk_container_forall (GTK_CONTAINER (combo),
+                       set_filter_tooltip,
+                       impl->tooltips);
+}
+
 /* Creates the widgets for the files/folders pane */
 static GtkWidget *
 file_pane_create (GtkFileChooserDefault *impl,
@@ -3142,7 +3165,6 @@ file_pane_create (GtkFileChooserDefault *impl,
 {
   GtkWidget *vbox;
   GtkWidget *hbox;
-  GtkWidget *ebox;
   GtkWidget *widget;
 
   vbox = gtk_vbox_new (FALSE, 6);
@@ -3185,17 +3207,12 @@ file_pane_create (GtkFileChooserDefault *impl,
   impl->filter_combo_hbox = gtk_hbox_new (FALSE, 12);
 
   widget = filter_create (impl);
-  ebox = gtk_event_box_new ();
-  gtk_container_add (GTK_CONTAINER (ebox), widget);
-  gtk_widget_show (ebox);
-  /* We need enter/leave to do tooltips */
-  gtk_widget_add_events (ebox, GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK);
-  gtk_tooltips_set_tip (impl->tooltips, ebox,
-                        _("Select which types of files are shown"), NULL);
 
+  g_signal_connect (widget, "realize",
+                   G_CALLBACK (realize_filter_combo), impl);
 
   gtk_widget_show (widget);
-  gtk_box_pack_end (GTK_BOX (impl->filter_combo_hbox), ebox, FALSE, FALSE, 0);
+  gtk_box_pack_end (GTK_BOX (impl->filter_combo_hbox), widget, FALSE, FALSE, 0);
 
   gtk_size_group_add_widget (size_group, impl->filter_combo_hbox);
   gtk_box_pack_end (GTK_BOX (vbox), impl->filter_combo_hbox, FALSE, FALSE, 0);