From af615c2c7ec1d496e514020a105bb2dded0a7e97 Mon Sep 17 00:00:00 2001 From: p3732 Date: Thu, 25 Oct 2018 04:32:30 +0200 Subject: [PATCH] Add main menu to sidebar Add main menu to the folder header, as described on https://gitlab.gnome.org/GNOME/Initiatives/wikis/App-Menu-Retirement#3-applications-that-use-a-sidebar-for-navigation The "About" string changed to "About Geary" and needs to be retranslated. --- src/client/components/main-toolbar.vala | 4 ++++ ui/gtk/menus.ui | 6 ----- ui/main-toolbar-menus.ui | 31 +++++++++++++++++++++++++ ui/main-toolbar.ui | 27 ++++++++++++++++++--- 4 files changed, 59 insertions(+), 9 deletions(-) diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala index 247a255b..605f9a9e 100644 --- a/src/client/components/main-toolbar.vala +++ b/src/client/components/main-toolbar.vala @@ -39,6 +39,8 @@ public class MainToolbar : Gtk.Box { private Gtk.MenuButton empty_menu_button; [GtkChild] private Gtk.ToggleButton search_conversations_button; + [GtkChild] + private Gtk.MenuButton main_menu_button; private Binding guest_header_binding; // Conversation header elements @@ -92,10 +94,12 @@ public class MainToolbar : Gtk.Box { // Assemble the empty/mark menus Gtk.Builder builder = new Gtk.Builder.from_resource("/org/gnome/Geary/main-toolbar-menus.ui"); MenuModel empty_menu = (MenuModel) builder.get_object("empty_menu"); + MenuModel main_menu = (MenuModel) builder.get_object("main_menu"); MenuModel mark_menu = (MenuModel) builder.get_object("mark_message_menu"); // Setup folder header elements this.empty_menu_button.popover = new Gtk.Popover.from_model(null, empty_menu); + this.main_menu_button.popover = new Gtk.Popover.from_model(null, main_menu); this.bind_property("search-open", this.search_conversations_button, "active", BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL); diff --git a/ui/gtk/menus.ui b/ui/gtk/menus.ui index 50aa4e81..2a573eff 100644 --- a/ui/gtk/menus.ui +++ b/ui/gtk/menus.ui @@ -2,12 +2,6 @@ -
- - Compose Message - app.compose - -
A_ccounts diff --git a/ui/main-toolbar-menus.ui b/ui/main-toolbar-menus.ui index dea30ccb..19cc9971 100644 --- a/ui/main-toolbar-menus.ui +++ b/ui/main-toolbar-menus.ui @@ -37,4 +37,35 @@ win.mark-message-not-spam
+ +
+ + _Accounts + app.accounts + +
+
+ + _Preferences + app.preferences + + + _Keyboard Shortcuts + win.show-help-overlay + <Primary>F1 + action-missing + + + _Help + app.help + F1 + + + _About Geary + app.about + +
+ +
+ diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui index 8c128136..3b8964b4 100644 --- a/ui/main-toolbar.ui +++ b/ui/main-toolbar.ui @@ -1,5 +1,5 @@ - + @@ -61,7 +61,7 @@ end - 2 + 3 @@ -82,7 +82,27 @@ end - 3 + 4 + + + + + True + True + False + False + True + + + True + False + open-menu-symbolic + + + + + end + 2