[nautilus/wip/neilh/toolbar-reorg: 11/16] toolbar: change ownership of menu popover to the toolbar
- From: Neil Herald <neilh src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/neilh/toolbar-reorg: 11/16] toolbar: change ownership of menu popover to the toolbar
- Date: Wed, 22 Jun 2016 23:04:53 +0000 (UTC)
commit 83ca885949386f6514ffc77c3a9c18189cfc6a6a
Author: Neil Herald <neil herald gmail com>
Date: Sat May 21 18:34:42 2016 +0100
toolbar: change ownership of menu popover to the toolbar
Prior changes to merge the view and action menus essentially moved the
action menu items into the view menu. This was the path of least
resistance; the view has a lot of hooks on items in the view menu,
whereas the there are very few hooks on items in the action menu,
meaning the latter could be moved more easily.
However, previously the view menu was disabled for Other Locations and
the action menu wasn't. So the side effect of the changes is the
remaining menu is now disabled completely on Other Locations. There are
a couple of items that could be shown for Other Locations (e.g. New
Tab), so we still want to show a menu, but this involves some
refactoring so has been deferred until now.
This commit is the first part of the refactoring; the files view owns
the menu popover, meaning that the Other Locations view doesn't have
access to it. This commit moves the ownership of the menu popover to the
toolbar. Future commits will move the common items into the popover so
all views will show them.
https://bugzilla.gnome.org/show_bug.cgi?id=764632
src/nautilus-files-view.c | 4 +-
src/nautilus-places-view.c | 2 +-
src/nautilus-toolbar.c | 58 ++--
src/nautilus-view.c | 3 +-
src/nautilus-view.h | 4 +-
src/resources/ui/nautilus-toolbar-view-menu.ui | 477 ++++++++++++------------
src/resources/ui/nautilus-toolbar.ui | 19 +
7 files changed, 295 insertions(+), 272 deletions(-)
---
diff --git a/src/nautilus-files-view.c b/src/nautilus-files-view.c
index 9a00183..74f08f3 100644
--- a/src/nautilus-files-view.c
+++ b/src/nautilus-files-view.c
@@ -637,8 +637,8 @@ nautilus_files_view_get_icon (NautilusView *view)
* nautilus_files_view_get_view_widget:
* @view: a #NautilusFilesView
*
- * Retrieves the view menu, as a #GtkWidget. If it's %NULL,
- * the button renders insensitive.
+ * Retrieves the menu section, as a #GtkWidget that should be added to the toolbar
+ * menu for this view. If it's %NULL, no widget is added for this view
*
* Returns: (transfer none): a #GtkWidget for the view menu
*/
diff --git a/src/nautilus-places-view.c b/src/nautilus-places-view.c
index f6214f8..ed46f20 100644
--- a/src/nautilus-places-view.c
+++ b/src/nautilus-places-view.c
@@ -283,7 +283,7 @@ nautilus_places_view_set_search_query (NautilusView *view,
static GtkWidget*
nautilus_places_view_get_view_widget (NautilusView *view)
{
- /* By returning NULL, the view menu button turns insensitive */
+ /* By returning NULL, no section will be added to the toolbar menu when this view is active */
return NULL;
}
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index f64f84f..63aa3ff 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -66,6 +66,7 @@ struct _NautilusToolbarPrivate {
GtkWidget *operations_button;
GtkWidget *view_button;
+ GtkWidget *view_menu_slot_section;
GtkWidget *view_toggle_button;
GtkWidget *view_toggle_icon;
@@ -889,6 +890,7 @@ nautilus_toolbar_class_init (NautilusToolbarClass *klass)
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);
gtk_widget_class_bind_template_child_private (widget_class, NautilusToolbar, path_bar_container);
@@ -953,29 +955,39 @@ nautilus_toolbar_view_toggle_icon_transform_to (GBinding *binding,
return TRUE;
}
-static gboolean
-nautilus_toolbar_view_widget_transform_to (GBinding *binding,
- const GValue *from_value,
- GValue *to_value,
- gpointer user_data)
+static void
+on_slot_view_widget_changed (NautilusToolbar *toolbar,
+ GParamSpec *param,
+ NautilusWindowSlot *slot)
{
- NautilusToolbar *toolbar;
GtkWidget *view_widget;
+ GList *children;
+ GList *child;
- toolbar = NAUTILUS_TOOLBAR (user_data);
- view_widget = g_value_get_object (from_value);
+ children = gtk_container_get_children (GTK_CONTAINER (toolbar->priv->view_menu_slot_section));
+ for (child = children; child != NULL; child = g_list_next (child)) {
+ gtk_container_remove (GTK_CONTAINER (toolbar->priv->view_menu_slot_section),
+ GTK_WIDGET (child->data));
+ }
+ g_list_free (children);
- gtk_menu_button_set_popover (GTK_MENU_BUTTON (toolbar->priv->view_button), NULL);
+ 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;
- g_value_set_object (to_value, view_widget);
+ gtk_box_pack_start (GTK_BOX (toolbar->priv->view_menu_slot_section), view_widget, FALSE, FALSE, 0);
+}
- /* Make the sensitivity change after the popover has been set, so that the sensitivity
- * propagates to the popover. Otherwise the popover will remain greyed out after
- * switching to a previous tab
- */
- gtk_widget_set_sensitive (toolbar->priv->view_button, view_widget != NULL);
+static void
+disconnect_view_widget_change_handler (NautilusToolbar *toolbar)
+{
+ if (toolbar->priv->active_slot == NULL)
+ return;
- return TRUE;
+ g_signal_handlers_disconnect_by_func (toolbar->priv->active_slot,
+ G_CALLBACK (on_slot_view_widget_changed),
+ toolbar);
}
void
@@ -988,6 +1000,7 @@ nautilus_toolbar_set_active_slot (NautilusToolbar *toolbar,
g_clear_pointer (&toolbar->priv->view_widget_binding, g_binding_unbind);
if (toolbar->priv->active_slot != slot) {
+ disconnect_view_widget_change_handler (toolbar);
toolbar->priv->active_slot = slot;
if (slot) {
@@ -999,16 +1012,11 @@ nautilus_toolbar_set_active_slot (NautilusToolbar *toolbar,
NULL,
toolbar,
NULL);
- toolbar->priv->view_widget_binding =
- g_object_bind_property_full (slot, "view-widget",
- toolbar->priv->view_button, "popover",
- G_BINDING_DEFAULT |
G_BINDING_SYNC_CREATE,
- (GBindingTransformFunc)
nautilus_toolbar_view_widget_transform_to,
- NULL,
- toolbar,
- NULL);
- }
+ on_slot_view_widget_changed (toolbar, NULL, slot);
+ g_signal_connect_swapped (slot, "notify::view-widget",
+ G_CALLBACK (on_slot_view_widget_changed), toolbar);
+ }
}
}
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 1791602..79b9dc4 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -118,7 +118,8 @@ nautilus_view_get_icon (NautilusView *view)
* nautilus_view_get_view_widget:
* @view: a #NautilusView
*
- * Retrieves the view menu widget from @view.
+ * Retrieves the toolbar menu section (widget) from @view, that should be shown
+ * in the menu when this view is active
*
* Returns: (transfer none): the widget displayed under view menu.
*/
diff --git a/src/nautilus-view.h b/src/nautilus-view.h
index 2bc9a13..4d3f12f 100644
--- a/src/nautilus-view.h
+++ b/src/nautilus-view.h
@@ -39,8 +39,8 @@ struct _NautilusViewInterface
GIcon* (*get_icon) (NautilusView *view);
/*
- * The widget that is displayed under the view menu. When set to NULL, the
- * button gets insensitive.
+ * The toolbar menu section (widget), that should be shown in the menu
+ * when this view is active
*/
GtkWidget* (*get_view_widget) (NautilusView *view);
diff --git a/src/resources/ui/nautilus-toolbar-view-menu.ui b/src/resources/ui/nautilus-toolbar-view-menu.ui
index 8c66c9a..f5cba45 100644
--- a/src/resources/ui/nautilus-toolbar-view-menu.ui
+++ b/src/resources/ui/nautilus-toolbar-view-menu.ui
@@ -1,171 +1,197 @@
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <object class ="GtkPopoverMenu" id="view_menu_widget">
+ <object class="GtkBox" id="view_menu_widget">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ <property name="width_request">160</property>
<child>
- <object class="GtkBox">
+ <object class="GtkBox" id="new_buttons_box">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="border_width">9</property>
- <property name="orientation">vertical</property>
- <property name="width_request">160</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="GtkBox" id="new_buttons_box">
+ <object class="GtkButton" id="new-folder">
<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>
+ <property name="action_name">view.new-folder</property>
<child>
- <object class="GtkButton" id="new-folder">
+ <object class="GtkImage">
<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>
+ <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>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</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="GtkButton" id="bookmark-this-location">
+ <object class="GtkImage">
<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>
+ <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>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</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="GtkButton" id="new-tab">
+ <object class="GtkImage">
<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>
+ <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>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</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>
+ <style>
+ <class name="linked"/>
+ </style>
<child>
- <object class="GtkBox" id="zoom_controls_box">
+ <object class="GtkButton" id="zoom-out">
<property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="homogeneous">True</property>
- <style>
- <class name="linked"/>
- </style>
+ <property name="action-name">view.zoom-out</property>
<child>
- <object class="GtkButton" id="zoom-out">
+ <object class="GtkImage">
<property name="visible">True</property>
- <property name="action-name">view.zoom-out</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">zoom-out-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Zoom Out</property>
- </object>
- </child>
+ <property name="icon-name">zoom-out-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">Zoom Out</property>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
- </packing>
</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="zoom-default">
+ <property name="visible">True</property>
+ <property name="action_name">view.zoom-standard</property>
<child>
- <object class="GtkButton" id="zoom-default">
+ <object class="GtkLabel" id="zoom_level_label">
<property name="visible">True</property>
- <property name="action_name">view.zoom-standard</property>
- <child>
- <object class="GtkLabel" id="zoom_level_label">
- <property name="visible">True</property>
- <property name="width-chars">5</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Reset Zoom</property>
- </object>
- </child>
+ <property name="width-chars">5</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">Reset Zoom</property>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">1</property>
- </packing>
</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="zoom-in">
+ <property name="visible">True</property>
+ <property name="action_name">view.zoom-in</property>
<child>
- <object class="GtkButton" id="zoom-in">
+ <object class="GtkImage">
<property name="visible">True</property>
- <property name="action_name">view.zoom-in</property>
- <child>
- <object class="GtkImage">
- <property name="visible">True</property>
- <property name="icon-name">zoom-in-symbolic</property>
- <property name="icon-size">1</property>
- </object>
- </child>
- <child internal-child="accessible">
- <object class="AtkObject">
- <property name="accessible-name" translatable="yes">Zoom In</property>
- </object>
- </child>
+ <property name="icon-name">zoom-in-symbolic</property>
+ <property name="icon-size">1</property>
+ </object>
+ </child>
+ <child internal-child="accessible">
+ <object class="AtkObject">
+ <property name="accessible-name" translatable="yes">Zoom In</property>
</object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">2</property>
- </packing>
</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="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">6</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="undo">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">_Undo</property>
+ <property name="action-name">win.undo</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="redo">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">_Redo</property>
+ <property name="action-name">win.redo</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkBox" id="sort_menu">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
<child>
<object class="GtkSeparator">
<property name="visible">True</property>
@@ -175,151 +201,120 @@
</object>
</child>
<child>
- <object class="GtkModelButton" id="undo">
+ <object class="GtkLabel">
<property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">_Undo</property>
- <property name="action-name">win.undo</property>
+ <property name="sensitive">False</property>
+ <property name="label" translatable="yes">Sort</property>
+ <property name="xalign">0</property>
+ <style>
+ <class name="nautilus-menu-sort-heading" />
+ </style>
</object>
</child>
<child>
- <object class="GtkModelButton" id="redo">
+ <object class="GtkModelButton" id="sort_name">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="text" translatable="yes">_Redo</property>
- <property name="action-name">win.redo</property>
+ <property name="text" translatable="yes" context="Sort Criterion" comments="This is used to sort
by name in the toolbar view menu">_A-Z</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'name'</property>
</object>
</child>
<child>
- <object class="GtkBox" id="sort_menu">
+ <object class="GtkModelButton" id="sort_name_desc">
<property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="orientation">vertical</property>
- <child>
- <object class="GtkSeparator">
- <property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">6</property>
- </object>
- </child>
- <child>
- <object class="GtkLabel">
- <property name="visible">True</property>
- <property name="sensitive">False</property>
- <property name="label" translatable="yes">Sort</property>
- <property name="xalign">0</property>
- <style>
- <class name="nautilus-menu-sort-heading" />
- </style>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes" context="Sort Criterion" comments="This is used to
sort by name in the toolbar view menu">_A-Z</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'name'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_name_desc">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes" context="Sort Criterion" comments="This is used to
sort by name, in descending order in the toolbar view menu">_Z-A</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'name-desc'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_modification_date_desc">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">Last _Modified</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'modification-date-desc'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_modification_date">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">_First Modified</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'modification-date'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_size">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">_Size</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'size'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_type">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">_Type</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'type'</property>
- </object>
- </child>
- <child>
- <object class="GtkModelButton" id="sort_trash_time">
- <property name="visible">False</property>
- <property name="can_focus">True</property>
- <property name="text" translatable="yes">Last _Trashed</property>
- <property name="action-name">view.sort</property>
- <property name="action-target">'trash-time'</property>
- </object>
- </child>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes" context="Sort Criterion" comments="This is used to sort
by name, in descending order in the toolbar view menu">_Z-A</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'name-desc'</property>
</object>
</child>
<child>
- <object class="GtkSeparator">
+ <object class="GtkModelButton" id="sort_modification_date_desc">
<property name="visible">True</property>
- <property name="orientation">horizontal</property>
- <property name="margin-top">6</property>
- <property name="margin-bottom">6</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">Last _Modified</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'modification-date-desc'</property>
</object>
</child>
<child>
- <object class="GtkModelButton" id="visible_columns">
- <property name="visible">False</property>
+ <object class="GtkModelButton" id="sort_modification_date">
+ <property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="text" translatable="yes">_Visible Columns…</property>
- <property name="action-name">view.visible-columns</property>
+ <property name="text" translatable="yes">_First Modified</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'modification-date'</property>
</object>
</child>
<child>
- <object class="GtkModelButton" id="show_hidden_files">
+ <object class="GtkModelButton" id="sort_size">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="text" translatable="yes">Show _Hidden Files</property>
- <property name="action-name">view.show-hidden-files</property>
+ <property name="text" translatable="yes">_Size</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'size'</property>
</object>
</child>
<child>
- <object class="GtkModelButton" id="reload">
+ <object class="GtkModelButton" id="sort_type">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="text" translatable="yes">R_eload</property>
- <property name="action-name">win.reload</property>
+ <property name="text" translatable="yes">_Type</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'type'</property>
</object>
</child>
<child>
- <object class="GtkModelButton" id="stop">
+ <object class="GtkModelButton" id="sort_trash_time">
<property name="visible">False</property>
<property name="can_focus">True</property>
- <property name="text" translatable="yes">St_op</property>
- <property name="action-name">win.stop</property>
+ <property name="text" translatable="yes">Last _Trashed</property>
+ <property name="action-name">view.sort</property>
+ <property name="action-target">'trash-time'</property>
</object>
</child>
</object>
</child>
+ <child>
+ <object class="GtkSeparator">
+ <property name="visible">True</property>
+ <property name="orientation">horizontal</property>
+ <property name="margin-top">6</property>
+ <property name="margin-bottom">6</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="visible_columns">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">_Visible Columns…</property>
+ <property name="action-name">view.visible-columns</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="show_hidden_files">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">Show _Hidden Files</property>
+ <property name="action-name">view.show-hidden-files</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="reload">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">R_eload</property>
+ <property name="action-name">win.reload</property>
+ </object>
+ </child>
+ <child>
+ <object class="GtkModelButton" id="stop">
+ <property name="visible">False</property>
+ <property name="can_focus">True</property>
+ <property name="text" translatable="yes">St_op</property>
+ <property name="action-name">win.stop</property>
+ </object>
+ </child>
</object>
</interface>
diff --git a/src/resources/ui/nautilus-toolbar.ui b/src/resources/ui/nautilus-toolbar.ui
index 3c3b1d5..21a751c 100644
--- a/src/resources/ui/nautilus-toolbar.ui
+++ b/src/resources/ui/nautilus-toolbar.ui
@@ -76,6 +76,7 @@
<property name="visible">True</property>
<property name="sensitive">True</property>
<property name="action_name">win.view-menu</property>
+ <property name="popover">view_menu_popover</property>
<style>
<class name="image-button"/>
</style>
@@ -201,4 +202,22 @@
</object>
</child>
</object>
+ <object class="GtkPopoverMenu" id="view_menu_popover">
+ <child>
+ <object class="GtkBox">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="border_width">9</property>
+ <property name="orientation">vertical</property>
+ <property name="width_request">160</property>
+ <child>
+ <object class="GtkBox" id="view_menu_slot_section">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="orientation">vertical</property>
+ </object>
+ </child>
+ </object>
+ </child>
+ </object>
</interface>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]