summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNeil Herald <neil.herald@gmail.com>2016-05-21 20:12:22 +0100
committerNeil Herald <neil.herald@gmail.com>2016-06-22 23:38:23 +0100
commitd60524355532d92961b118ce2bc7df8e4e18f35e (patch)
tree9dd8970d54f4de40dd46be83b4846acc3969fdde
parent83ca885949386f6514ffc77c3a9c18189cfc6a6a (diff)
downloadnautilus-d60524355532d92961b118ce2bc7df8e4e18f35e.tar.gz
toolbar: move the new folder/tab/bookmark items into the shared popover
The files view creates and owns these buttons currently, meaning they aren't shown on the menu when the Other Locations view is active. This change moves the menu items from the view's toolbar menu ui file and into the ui file for the shared popover, so that the buttons are also shown for Other Locations. https://bugzilla.gnome.org/show_bug.cgi?id=764632
-rw-r--r--src/nautilus-toolbar.c3
-rw-r--r--src/resources/ui/nautilus-toolbar-view-menu.ui81
-rw-r--r--src/resources/ui/nautilus-toolbar.ui81
3 files changed, 81 insertions, 84 deletions
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 63aa3ff8b..767254e4a 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -65,7 +65,6 @@ struct _NautilusToolbarPrivate {
guint operations_button_attention_timeout_id;
GtkWidget *operations_button;
- GtkWidget *view_button;
GtkWidget *view_menu_slot_section;
GtkWidget *view_toggle_button;
GtkWidget *view_toggle_icon;
@@ -889,7 +888,6 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, operations_popover);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, operations_container);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, operations_revealer);
- gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, view_button);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, view_menu_slot_section);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, view_toggle_button);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, view_toggle_icon);
@@ -972,7 +970,6 @@ on_slot_view_widget_changed (NautilusToolbar *toolbar,
g_list_free (children);
view_widget = nautilus_window_slot_get_view_widget (slot);
- gtk_widget_set_sensitive (toolbar->priv->view_button, view_widget != NULL);
if (view_widget == NULL)
return;
diff --git a/src/resources/ui/nautilus-toolbar-view-menu.ui b/src/resources/ui/nautilus-toolbar-view-menu.ui
index f5cba450a..0d720752a 100644
--- a/src/resources/ui/nautilus-toolbar-view-menu.ui
+++ b/src/resources/ui/nautilus-toolbar-view-menu.ui
@@ -6,90 +6,11 @@
<property name="orientation">vertical</property>
<property name="width_request">160</property>
<child>
- <object class="GtkBox" id="new_buttons_box">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="homogeneous">True</property>
- <property name="margin-bottom">9</property>
- <style>
- <class name="linked"/>
- </style>
- <child>
- <object class="GtkButton" id="new-folder">
- <property name="visible">True</property>
- <property name="action_name">view.new-folder</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">folder-new-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">New Folder</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="bookmark-this-location">
- <property name="visible">True</property>
- <property name="action_name">win.bookmark-current-location</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">bookmark-new-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Bookmark this Location</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkButton" id="new-tab">
- <property name="visible">True</property>
- <property name="action-name">win.new-tab</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">tab-new-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">New Tab</property>
- </object>
- </child>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
- </child>
- </object>
- </child>
- <child>
<object class="GtkBox" id="zoom_controls_box">
<property name="visible">True</property>
<property name="orientation">horizontal</property>
<property name="homogeneous">True</property>
+ <property name="margin-top">9</property>
<style>
<class name="linked"/>
</style>
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index 21a751c3b..c63fa8abf 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -72,7 +72,7 @@
</packing>
</child>
<child>
- <object class="GtkMenuButton" id="view_button">
+ <object class="GtkMenuButton" id="view-button">
<property name="visible">True</property>
<property name="sensitive">True</property>
<property name="action_name">win.view-menu</property>
@@ -211,6 +211,85 @@
<property name="orientation">vertical</property>
<property name="width_request">160</property>
<child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="homogeneous">True</property>
+ <style>
+ <class name="linked"/>
+ </style>
+ <child>
+ <object class="GtkButton" id="new-folder">
+ <property name="visible">True</property>
+ <property name="action_name">view.new-folder</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">folder-new-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">New Folder</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="bookmark-this-location">
+ <property name="visible">True</property>
+ <property name="action_name">win.bookmark-current-location</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">bookmark-new-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">Bookmark this Location</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkButton" id="new-tab">
+ <property name="visible">True</property>
+ <property name="action-name">win.new-tab</property>
+ <child>
+ <object class="GtkImage">
+ <property name="visible">True</property>
+ <property name="icon-name">tab-new-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">New Tab</property>
+ </object>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ </object>
+ </child>
+ <child>
<object class="GtkBox" id="view_menu_slot_section">
<property name="visible">True</property>
<property name="can_focus">False</property>