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



commit e02252cdd6f800a41ef3a2e3195fd1d053b82f4c
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 d7cd8a3..3c1b65d 100644
--- a/gtk/gtkfilechooserdefault.c
+++ b/gtk/gtkfilechooserdefault.c
@@ -4927,8 +4927,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);
@@ -4965,6 +4963,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 */
 
@@ -4972,6 +4971,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"));
@@ -8847,7 +8847,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 */
@@ -8892,6 +8891,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 */
 
@@ -9273,10 +9273,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 */
@@ -9291,6 +9290,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]