file-chooser: allow views to extend to the sides of the dialog

https://bugzilla.gnome.org/show_bug.cgi?id=722211
This commit is contained in:
William Jon McCann 2014-04-07 17:18:56 -04:00 committed by Matthias Clasen
parent 458cd04c13
commit df9522d8a8
3 changed files with 21 additions and 14 deletions

View File

@ -1960,6 +1960,7 @@ save_widgets_create (GtkFileChooserWidget *impl)
location_switch_to_path_bar (impl);
vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (vbox), 10);
priv->save_widgets_table = gtk_grid_new ();
gtk_box_pack_start (GTK_BOX (vbox), priv->save_widgets_table, FALSE, FALSE, 0);
@ -2026,7 +2027,7 @@ location_switch_to_path_bar (GtkFileChooserWidget *impl)
priv->location_entry = NULL;
}
gtk_widget_hide (priv->location_entry_box);
gtk_widget_hide (priv->browse_header_box);
}
/* Turns on the location entry. Can be called even if we are already in that
@ -2038,7 +2039,7 @@ location_switch_to_filename_entry (GtkFileChooserWidget *impl)
GtkFileChooserWidgetPrivate *priv = impl->priv;
/* when in search or recent files mode, we are not showing the
* location_entry_box container, so there's no point in switching
* browse_header_box container, so there's no point in switching
* to it.
*/
if (priv->operation_mode == OPERATION_MODE_SEARCH ||
@ -2047,7 +2048,7 @@ location_switch_to_filename_entry (GtkFileChooserWidget *impl)
/* Box */
gtk_widget_show (priv->location_entry_box);
gtk_widget_show (priv->browse_header_box);
/* Entry */
@ -2142,7 +2143,7 @@ location_toggle_popup_handler (GtkFileChooserWidget *impl)
GtkFileChooserWidgetPrivate *priv = impl->priv;
/* when in search or recent files mode, we are not showing the
* location_entry_box container, so there's no point in switching
* browse_header_box container, so there's no point in switching
* to it.
*/
if (priv->operation_mode == OPERATION_MODE_SEARCH ||
@ -2586,7 +2587,7 @@ operation_mode_set_browse (GtkFileChooserWidget *impl)
location_mode_set (impl, priv->location_mode, TRUE);
if (priv->location_mode == LOCATION_MODE_FILENAME_ENTRY)
gtk_widget_show (priv->location_entry_box);
gtk_widget_show (priv->browse_header_box);
}
}
@ -2614,7 +2615,7 @@ operation_mode_set_recent (GtkFileChooserWidget *impl)
priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
{
gtk_widget_hide (priv->location_button);
gtk_widget_hide (priv->location_entry_box);
gtk_widget_hide (priv->browse_header_box);
}
recent_start_loading (impl);
@ -6441,7 +6442,7 @@ search_setup_widgets (GtkFileChooserWidget *impl)
priv->action == GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER)
{
gtk_widget_hide (priv->location_button);
gtk_widget_hide (priv->location_entry_box);
gtk_widget_hide (priv->browse_header_box);
}
focus_search_entry_in_idle (impl);

View File

@ -3,13 +3,14 @@
<!-- interface-requires gtk+ 3.10 -->
<template class="GtkFileChooserDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="border_width">0</property>
<property name="role">GtkFileChooserDialog</property>
<property name="type_hint">dialog</property>
<property name="default_width">600</property>
<signal name="response" handler="response_cb" swapped="no"/>
<child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1">
<property name="border_width">0</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">2</property>
@ -35,7 +36,7 @@
<object class="GtkFileChooserWidget" id="widget">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">5</property>
<property name="border_width">0</property>
<property name="orientation">vertical</property>
<signal name="default-size-changed" handler="file_chooser_widget_default_size_changed" swapped="no"/>
<signal name="file-activated" handler="file_chooser_widget_file_activated" swapped="no"/>

View File

@ -10,21 +10,23 @@
<template class="GtkFileChooserWidget" parent="GtkBox">
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="spacing">0</property>
<child>
<object class="GtkBox" id="browse_widgets_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
<property name="spacing">0</property>
<child>
<object class="GtkBox" id="browse_header_box">
<property name="visible">True</property>
<property name="visible">False</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="border_width">10</property>
<property name="spacing">12</property>
<child>
<object class="GtkBox" id="location_entry_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<child>
@ -61,12 +63,13 @@
<object class="GtkPaned" id="browse_widgets_hpaned">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="border_width">0</property>
<child>
<object class="GtkPlacesSidebar" id="places_sidebar">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
<property name="shadow_type">in</property>
<property name="shadow_type">none</property>
<property name="local_only">True</property>
<signal name="open-location" handler="places_sidebar_open_location_cb" swapped="no"/>
<signal name="show-error-message" handler="places_sidebar_show_error_message_cb" swapped="no"/>
@ -81,12 +84,13 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<property name="spacing">0</property>
<child>
<object class="GtkBox" id="browse_path_bar_hbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="spacing">12</property>
<property name="border_width">6</property>
<child>
<object class="GtkToggleButton" id="location_button">
<property name="visible">True</property>
@ -345,6 +349,7 @@
<child>
<object class="GtkBox" id="extra_and_filters">
<property name="visible">True</property>
<property name="border_width">10</property>
<child>
<object class="GtkBox" id="extra_align">
<property name="can_focus">False</property>