[nautilus] Add a view menu button to the toolbar
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Add a view menu button to the toolbar
- Date: Thu, 9 Aug 2012 14:12:33 +0000 (UTC)
commit 55420e17214141e931c6b87a314ee7b8874ecda0
Author: William Jon McCann <jmccann redhat com>
Date: Wed Aug 8 08:38:20 2012 -0400
Add a view menu button to the toolbar
https://bugzilla.gnome.org/show_bug.cgi?id=680985
src/nautilus-canvas-view-ui.xml | 41 +++++++++++++++--------------------
src/nautilus-directory-view-ui.xml | 12 +++++-----
src/nautilus-list-view-ui.xml | 8 ++----
src/nautilus-shell-ui.xml | 34 +++++++++++++++--------------
src/nautilus-toolbar.c | 8 +++++-
src/nautilus-view.c | 12 +++++-----
src/nautilus-window-menus.c | 2 +-
7 files changed, 58 insertions(+), 59 deletions(-)
---
diff --git a/src/nautilus-canvas-view-ui.xml b/src/nautilus-canvas-view-ui.xml
index 750cbda..014e8f2 100644
--- a/src/nautilus-canvas-view-ui.xml
+++ b/src/nautilus-canvas-view-ui.xml
@@ -1,29 +1,24 @@
<ui>
<popup name="ViewMenu">
- <menu action="Edit">
- <placeholder name="Edit Items Placeholder">
- <menuitem name="Stretch" action="Stretch"/>
- <menuitem name="Unstretch" action="Unstretch"/>
+ <placeholder name="Layout Options">
+ <menuitem name="Manual Layout" action="Manual Layout"/>
+ <placeholder name="Auto Layout">
+ <menuitem name="Sort by Name" action="Sort by Name"/>
+ <menuitem name="Sort by Size" action="Sort by Size"/>
+ <menuitem name="Sort by Type" action="Sort by Type"/>
+ <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
+ <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
</placeholder>
- </menu>
- <menu action="View">
- <placeholder name="View Items Placeholder">
- <menu action="Arrange Items">
- <menuitem name="Manual Layout" action="Manual Layout"/>
- <placeholder name="Auto Layout">
- <menuitem name="Sort by Name" action="Sort by Name"/>
- <menuitem name="Sort by Size" action="Sort by Size"/>
- <menuitem name="Sort by Type" action="Sort by Type"/>
- <menuitem name="Sort by Modification Date" action="Sort by Modification Date"/>
- <menuitem name="Sort by Trash Time" action="Sort by Trash Time"/>
- </placeholder>
- <separator name="Layout separator"/>
- <menuitem name="Reversed Order" action="Reversed Order"/>
- </menu>
- <menuitem name="Clean Up" action="Clean Up"/>
- <menuitem name="Keep Aligned" action="Keep Aligned"/>
- </placeholder>
- </menu>
+ <separator name="Layout separator"/>
+ <menuitem name="Reversed Order" action="Reversed Order"/>
+ <menuitem name="Clean Up" action="Clean Up"/>
+ <menuitem name="Keep Aligned" action="Keep Aligned"/>
+ </placeholder>
+ <separator/>
+ <placeholder name="View Details">
+ <menuitem name="Stretch" action="Stretch"/>
+ <menuitem name="Unstretch" action="Unstretch"/>
+ </placeholder>
</popup>
<popup name="background">
<placeholder name="Before Zoom Items">
diff --git a/src/nautilus-directory-view-ui.xml b/src/nautilus-directory-view-ui.xml
index f5e1da1..f9ad94a 100644
--- a/src/nautilus-directory-view-ui.xml
+++ b/src/nautilus-directory-view-ui.xml
@@ -5,6 +5,12 @@
<accelerator action="PropertiesAccel"/>
<accelerator action="RenameSelectAll"/>
<popup name="ViewMenu">
+ <placeholder name="View Details">
+ <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
+ <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
+ </placeholder>
+</popup>
+<popup name="ActionMenu">
<placeholder name="New Items Placeholder">
<menuitem name="New Folder" action="New Folder"/>
<menuitem name="New Folder with Selection" action="New Folder with Selection"/>
@@ -76,12 +82,6 @@
</placeholder>
<placeholder name="Extension Actions"/>
</menu>
- <menu action="View">
- <placeholder name="View Preferences Placeholder">
- <menuitem name="Reset to Defaults" action="Reset to Defaults"/>
- <menuitem name="Show Hidden Files" action="Show Hidden Files"/>
- </placeholder>
- </menu>
</popup>
<popup name="background">
<placeholder name="Before Zoom Items">
diff --git a/src/nautilus-list-view-ui.xml b/src/nautilus-list-view-ui.xml
index ac3699c..22ca858 100644
--- a/src/nautilus-list-view-ui.xml
+++ b/src/nautilus-list-view-ui.xml
@@ -1,9 +1,7 @@
<ui>
<popup name="ViewMenu">
- <menu action="View">
- <placeholder name="View Items Placeholder">
- <menuitem name="Visible Columns" action="Visible Columns"/>
- </placeholder>
- </menu>
+ <placeholder name="View Details">
+ <menuitem name="Visible Columns" action="Visible Columns"/>
+ </placeholder>
</popup>
</ui>
diff --git a/src/nautilus-shell-ui.xml b/src/nautilus-shell-ui.xml
index 803a417..4ecf8ab 100644
--- a/src/nautilus-shell-ui.xml
+++ b/src/nautilus-shell-ui.xml
@@ -8,6 +8,24 @@
<accelerator action="ZoomInAccel2"/>
<accelerator action="ZoomOutAccel"/>
<popup name="ViewMenu">
+ <placeholder name="Zoom Items Placeholder">
+ <menuitem name="Zoom In" action="Zoom In"/>
+ <menuitem name="Zoom Out" action="Zoom Out"/>
+ <menuitem name="Zoom Normal" action="Zoom Normal"/>
+ </placeholder>
+ <separator/>
+ <menuitem name="Stop" action="Stop"/>
+ <menuitem name="Reload" action="Reload"/>
+ <separator/>
+ <placeholder name="Layout Options"/>
+ <separator/>
+ <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
+ <separator/>
+ <placeholder name="View Preferences"/>
+ <separator/>
+ <placeholder name="View Details"/>
+</popup>
+<popup name="ActionMenu">
<placeholder name="New Items Placeholder">
<menuitem name="New Tab" action="New Tab"/>
<menuitem name="New Window" action="New Window"/>
@@ -41,22 +59,6 @@
<separator/>
<menuitem name="Preferences" action="Preferences"/>
</menu>
- <menu action="View">
- <menuitem name="Stop" action="Stop"/>
- <menuitem name="Reload" action="Reload"/>
- <separator/>
- <menuitem name="Show Hide Sidebar" action="Show Hide Sidebar"/>
- <separator/>
- <placeholder name="View Preferences Placeholder"/>
- <separator/>
- <placeholder name="View Items Placeholder"/>
- <separator/>
- <placeholder name="Zoom Items Placeholder">
- <menuitem name="Zoom In" action="Zoom In"/>
- <menuitem name="Zoom Out" action="Zoom Out"/>
- <menuitem name="Zoom Normal" action="Zoom Normal"/>
- </placeholder>
- </menu>
<menu action="Bookmarks">
<menuitem name="Add Bookmark" action="Add Bookmark"/>
<menuitem name="Edit Bookmark" action="Edit Bookmarks"/>
diff --git a/src/nautilus-toolbar.c b/src/nautilus-toolbar.c
index 87cab0d..c6d911f 100644
--- a/src/nautilus-toolbar.c
+++ b/src/nautilus-toolbar.c
@@ -208,6 +208,10 @@ nautilus_toolbar_constructed (GObject *obj)
gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (tool_button));
tool_button = toolbar_create_toolbutton (self, FALSE, TRUE, NAUTILUS_ACTION_VIEW_GRID);
gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (tool_button));
+ tool_button = toolbar_create_toolbutton (self, TRUE, FALSE, "go-down-symbolic");
+ gtk_container_add (GTK_CONTAINER (box), GTK_WIDGET (tool_button));
+ menu = gtk_ui_manager_get_widget (self->priv->ui_manager, "/ViewMenu");
+ gtk_menu_button_set_menu (GTK_MENU_BUTTON (tool_button), menu);
gtk_style_context_add_class (gtk_widget_get_style_context (box),
GTK_STYLE_CLASS_RAISED);
@@ -219,10 +223,10 @@ nautilus_toolbar_constructed (GObject *obj)
gtk_widget_show_all (GTK_WIDGET (tool_item));
gtk_widget_set_margin_left (GTK_WIDGET (tool_item), 12);
- /* Page Menu */
+ /* Action Menu */
tool_item = gtk_tool_item_new ();
tool_button = toolbar_create_toolbutton (self, TRUE, FALSE, "emblem-system-symbolic");
- menu = gtk_ui_manager_get_widget (self->priv->ui_manager, "/ViewMenu");
+ menu = gtk_ui_manager_get_widget (self->priv->ui_manager, "/ActionMenu");
gtk_menu_button_set_menu (GTK_MENU_BUTTON (tool_button), menu);
gtk_actionable_set_action_name (GTK_ACTIONABLE (tool_button), "win.gear-menu");
diff --git a/src/nautilus-view.c b/src/nautilus-view.c
index 5d2823f..4fe37dd 100644
--- a/src/nautilus-view.c
+++ b/src/nautilus-view.c
@@ -105,12 +105,12 @@
#define MAX_QUEUED_UPDATES 500
-#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/ViewMenu/Open Placeholder/Open With/Applications Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/ViewMenu/Open Placeholder/Applications Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/ViewMenu/Open Placeholder/Scripts/Scripts Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_EXTENSION_ACTIONS_PLACEHOLDER "/ViewMenu/Edit/Extension Actions"
-#define NAUTILUS_VIEW_MENU_PATH_NEW_DOCUMENTS_PLACEHOLDER "/ViewMenu/New Items Placeholder/New Documents/New Documents Placeholder"
-#define NAUTILUS_VIEW_MENU_PATH_OPEN "/ViewMenu/Open Placeholder/Open"
+#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/ActionMenu/Open Placeholder/Open With/Applications Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_APPLICATIONS_PLACEHOLDER "/ActionMenu/Open Placeholder/Applications Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_SCRIPTS_PLACEHOLDER "/ActionMenu/Open Placeholder/Scripts/Scripts Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_EXTENSION_ACTIONS_PLACEHOLDER "/ActionMenu/Edit/Extension Actions"
+#define NAUTILUS_VIEW_MENU_PATH_NEW_DOCUMENTS_PLACEHOLDER "/ActionMenu/New Items Placeholder/New Documents/New Documents Placeholder"
+#define NAUTILUS_VIEW_MENU_PATH_OPEN "/ActionMenu/Open Placeholder/Open"
#define NAUTILUS_VIEW_POPUP_PATH_SELECTION "/selection"
#define NAUTILUS_VIEW_POPUP_PATH_APPLICATIONS_SUBMENU_PLACEHOLDER "/selection/Open Placeholder/Open With/Applications Placeholder"
diff --git a/src/nautilus-window-menus.c b/src/nautilus-window-menus.c
index e1a36d5..25f56a7 100644
--- a/src/nautilus-window-menus.c
+++ b/src/nautilus-window-menus.c
@@ -58,7 +58,7 @@
#include <libnautilus-private/nautilus-trash-monitor.h>
#include <string.h>
-#define MENU_PATH_EXTENSION_ACTIONS "/ViewMenu/Extension Actions"
+#define MENU_PATH_EXTENSION_ACTIONS "/ActionMenu/Extension Actions"
#define POPUP_PATH_EXTENSION_ACTIONS "/background/Before Zoom Items/Extension Actions"
#define NETWORK_URI "network:"
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]