Permalink
Browse files

Move the widgets above the hpaned to their own box

This way we can re-create the contents of that box easily without disrupting
the rest of the file chooser.

Signed-off-by: Federico Mena Quintero <federico@gnome.org>
  • Loading branch information...
1 parent c1fbdb4 commit 3de864cfff7da1823d37bc23f1b8ffdfd0196e87 @federicomenaquintero federicomenaquintero committed Jul 27, 2011
Showing with 13 additions and 7 deletions.
  1. +12 −7 gtk/gtkfilechooserdefault.c
  2. +1 −0 gtk/gtkfilechooserprivate.h
@@ -4920,22 +4920,29 @@ browse_widgets_create (GtkFileChooserDefault *impl)
GtkWidget *widget;
GtkSizeGroup *size_group;
- /* size group is used by the scrolled windows of the panes */
- size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
impl->browse_widgets_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+ gtk_box_pack_start (GTK_BOX (impl), impl->browse_widgets_box, TRUE, TRUE, 0);
+ gtk_widget_show (impl->browse_widgets_box);
+
+ impl->browse_header_box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
+ gtk_box_pack_start (GTK_BOX (impl->browse_widgets_box), impl->browse_header_box, FALSE, FALSE, 0);
+ gtk_widget_show (impl->browse_header_box);
/* Path bar, info bar, and their respective machinery - the browse_path_bar_hbox will get packed elsewhere */
path_bar_widgets_create (impl);
/* Box for the location label and entry */
impl->location_entry_box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
- gtk_box_pack_start (GTK_BOX (impl->browse_widgets_box), impl->location_entry_box, FALSE, FALSE, 0);
+ gtk_box_pack_start (GTK_BOX (impl->browse_header_box), impl->location_entry_box, FALSE, FALSE, 0);
impl->location_label = gtk_label_new_with_mnemonic (_("_Location:"));
gtk_widget_show (impl->location_label);
gtk_box_pack_start (GTK_BOX (impl->location_entry_box), impl->location_label, FALSE, FALSE, 0);
+ /* size group is used by the scrolled windows of the panes */
+ size_group = gtk_size_group_new (GTK_SIZE_GROUP_VERTICAL);
+
/* Paned widget */
hpaned = gtk_paned_new (GTK_ORIENTATION_HORIZONTAL);
@@ -4974,7 +4981,6 @@ gtk_file_chooser_default_constructor (GType type,
/* The browse widgets */
browse_widgets_create (impl);
- gtk_box_pack_start (GTK_BOX (impl), impl->browse_widgets_box, TRUE, TRUE, 0);
/* Alignment to hold extra widget */
impl->extra_align = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
@@ -5147,8 +5153,8 @@ restore_path_bar (GtkFileChooserDefault *impl)
if (impl->action == GTK_FILE_CHOOSER_ACTION_OPEN
|| impl->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
{
- gtk_box_pack_start (GTK_BOX (impl->browse_widgets_box), impl->browse_path_bar_hbox, FALSE, FALSE, 0);
- gtk_box_reorder_child (GTK_BOX (impl->browse_widgets_box), impl->browse_path_bar_hbox, 0);
+ gtk_box_pack_start (GTK_BOX (impl->browse_header_box), impl->browse_path_bar_hbox, FALSE, FALSE, 0);
+ gtk_box_reorder_child (GTK_BOX (impl->browse_header_box), impl->browse_path_bar_hbox, 0);
}
else if (impl->action == GTK_FILE_CHOOSER_ACTION_SAVE
|| impl->action == GTK_FILE_CHOOSER_ACTION_CREATE_FOLDER)
@@ -5390,7 +5396,6 @@ update_appearance (GtkFileChooserDefault *impl)
{
gtk_widget_show (impl->location_button);
save_widgets_destroy (impl);
- gtk_widget_show (impl->browse_widgets_box);
location_mode_set (impl, impl->location_mode, TRUE);
}
@@ -168,6 +168,7 @@ struct _GtkFileChooserDefault
/* The file browsing widgets */
GtkWidget *browse_widgets_box;
+ GtkWidget *browse_header_box;
GtkWidget *browse_shortcuts_tree_view;
GtkWidget *browse_shortcuts_add_button;
GtkWidget *browse_shortcuts_remove_button;

0 comments on commit 3de864c

Please sign in to comment.