Skip to content
This repository has been archived by the owner on Nov 17, 2020. It is now read-only.

Commit

Permalink
Move the widgets above the hpaned to their own box
Browse files Browse the repository at this point in the history
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
federicomenaquintero committed Jul 27, 2011
1 parent c1fbdb4 commit 3de864c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
19 changes: 12 additions & 7 deletions gtk/gtkfilechooserdefault.c
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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);
}

Expand Down
1 change: 1 addition & 0 deletions gtk/gtkfilechooserprivate.h
Expand Up @@ -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;
Expand Down

0 comments on commit 3de864c

Please sign in to comment.