[gtk+/gtk-2-22] bgo#486839 - Fix path bar size group in the file chooser



commit 2363cccd24e6a96c765571e6f44f0656e548ac3d
Author: Milan Bouchet-Valat <nalimilan club fr>
Date:   Wed Oct 7 22:08:41 2009 +0200

    bgo#486839 - Fix path bar size group in the file chooser
    
    Since the location button is hidden in save mode, we need to add the
    path bar to the size group too. The location button still has to be in
    the group though, because it's larger than the path bar (when
    shown). Instead of using the recent/search icons, add their hboxes so
    that themed widget spacings don't introduce variations.

 gtk/gtkfilechooserdefault.c |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)
---
diff --git a/gtk/gtkfilechooserdefault.c b/gtk/gtkfilechooserdefault.c
index 3fef7db..70336a6 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -5090,8 +5090,6 @@ location_button_create (GtkFileChooserDefault *impl)
   impl->location_button = g_object_new (GTK_TYPE_TOGGLE_BUTTON,
 					"image", image,
 					NULL);
-  
-  gtk_size_group_add_widget (impl->browse_path_bar_size_group, impl->location_button);
 
   g_signal_connect (impl->location_button, "toggled",
 		    G_CALLBACK (location_button_toggled_cb), impl);
@@ -5128,6 +5126,7 @@ browse_widgets_create (GtkFileChooserDefault *impl)
 
   location_button_create (impl);
   gtk_box_pack_start (GTK_BOX (impl->browse_path_bar_hbox), impl->location_button, FALSE, FALSE, 0);
+  gtk_size_group_add_widget (impl->browse_path_bar_size_group, impl->location_button);
 
   /* Path bar */
 
@@ -5135,6 +5134,7 @@ browse_widgets_create (GtkFileChooserDefault *impl)
   g_signal_connect (impl->browse_path_bar, "path-clicked", G_CALLBACK (path_bar_clicked), impl);
   gtk_widget_show_all (impl->browse_path_bar);
   gtk_box_pack_start (GTK_BOX (impl->browse_path_bar_hbox), impl->browse_path_bar, TRUE, TRUE, 0);
+  gtk_size_group_add_widget (impl->browse_path_bar_size_group, impl->browse_path_bar);
 
   /* Create Folder */
   impl->browse_new_folder_button = gtk_button_new_with_mnemonic (_("Create Fo_lder"));
@@ -9021,7 +9021,6 @@ search_setup_widgets (GtkFileChooserDefault *impl)
   /* Image */
 
   image = gtk_image_new_from_stock (GTK_STOCK_FIND, GTK_ICON_SIZE_BUTTON);
-  gtk_size_group_add_widget (GTK_SIZE_GROUP (impl->browse_path_bar_size_group), image);
   gtk_box_pack_start (GTK_BOX (impl->search_hbox), image, FALSE, FALSE, 5);
 
   /* Label */
@@ -9066,6 +9065,7 @@ search_setup_widgets (GtkFileChooserDefault *impl)
   /* Box for search widgets */
   gtk_box_pack_start (GTK_BOX (impl->browse_path_bar_hbox), impl->search_hbox, TRUE, TRUE, 0);
   gtk_widget_show_all (impl->search_hbox);
+  gtk_size_group_add_widget (GTK_SIZE_GROUP (impl->browse_path_bar_size_group), impl->search_hbox);
 
   /* Hide the location widgets temporarily */
 
@@ -9447,10 +9447,9 @@ recent_hide_entry (GtkFileChooserDefault *impl)
   gchar *tmp;
 
   impl->recent_hbox = gtk_hbox_new (FALSE, 12);
-  
+
   /* Image */
   image = gtk_image_new_from_icon_name ("document-open-recent", GTK_ICON_SIZE_BUTTON);
-  gtk_size_group_add_widget (impl->browse_path_bar_size_group, image);
   gtk_box_pack_start (GTK_BOX (impl->recent_hbox), image, FALSE, FALSE, 5);
 
   /* Label */
@@ -9465,6 +9464,7 @@ recent_hide_entry (GtkFileChooserDefault *impl)
   
   /* Box for recent widgets */
   gtk_box_pack_start (GTK_BOX (impl->browse_path_bar_hbox), impl->recent_hbox, TRUE, TRUE, 0);
+  gtk_size_group_add_widget (impl->browse_path_bar_size_group, impl->recent_hbox);
   gtk_widget_show_all (impl->recent_hbox);
 
   /* Hide the location widgets temporarily */



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