diff --git a/src/client/application/application-client.vala b/src/client/application/application-client.vala index db8cdfdc..0bd704fc 100644 --- a/src/client/application/application-client.vala +++ b/src/client/application/application-client.vala @@ -1,6 +1,6 @@ /* * Copyright © 2016 Software Freedom Conservancy Inc. - * Copyright © 2019-2020 Michael Gratton + * Copyright © 2019-2021 Michael Gratton * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -400,6 +400,7 @@ public class Application.Client : Gtk.Application { add_window_accelerators( Action.Window.SHORTCUT_HELP, { "F1", "question" } ); + add_window_accelerators(Action.Window.SHOW_MENU, { "F10" }); // Common edit accels add_edit_accelerators(Action.Edit.COPY, { "C" }); diff --git a/src/client/application/application-main-window.vala b/src/client/application/application-main-window.vala index 27526e0e..589dc6cf 100644 --- a/src/client/application/application-main-window.vala +++ b/src/client/application/application-main-window.vala @@ -1,6 +1,6 @@ /* * Copyright © 2016 Software Freedom Conservancy Inc. - * Copyright © 2016, 2019-2020 Michael Gratton + * Copyright © 2016, 2019-2021 Michael Gratton * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -40,10 +40,12 @@ public class Application.MainWindow : private const ActionEntry[] WINDOW_ACTIONS = { { Action.Window.CLOSE, on_close }, + { Action.Window.SHOW_MENU, on_show_window_menu }, { ACTION_FIND_IN_CONVERSATION, on_find_in_conversation_action }, { ACTION_SEARCH, on_search_activated }, { ACTION_NAVIGATION_BACK, focus_previous_pane}, + // Message actions { ACTION_REPLY_CONVERSATION, on_reply_conversation }, { ACTION_REPLY_ALL_CONVERSATION, on_reply_all_conversation }, @@ -880,6 +882,17 @@ public class Application.MainWindow : } } + /** Shows the appopriate window menu, if any. */ + public void show_window_menu() { + if (this.main_leaflet.folded) { + this.main_leaflet.navigate(Hdy.NavigationDirection.BACK); + } + if (this.conversations_leaflet.folded) { + this.conversations_leaflet.navigate(Hdy.NavigationDirection.BACK); + } + this.main_toolbar.show_main_menu(); + } + /** Displays and focuses the search bar for the window. */ public void show_search_bar(string? text = null) { this.search_bar.grab_focus(); @@ -2250,6 +2263,10 @@ public class Application.MainWindow : this.create_composer_from_viewer.begin(FORWARD); } + private void on_show_window_menu() { + show_window_menu(); + } + private void on_show_copy_menu() { this.conversation_actions.copy_message_button.clicked(); } diff --git a/src/client/client-action.vala b/src/client/client-action.vala index 70997d20..3204ae89 100644 --- a/src/client/client-action.vala +++ b/src/client/client-action.vala @@ -1,5 +1,5 @@ /* - * Copyright 2019 Michael Gratton + * Copyright 2019-2021 Michael Gratton * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -44,6 +44,7 @@ namespace Action { public const string CLOSE = "close"; public const string SHORTCUT_HELP = "show-help-overlay"; + public const string SHOW_MENU = "show-menu"; /** Returns the given action name prefixed with the group name. */ diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala index ab0e3ba1..252b106c 100644 --- a/src/client/components/main-toolbar.vala +++ b/src/client/components/main-toolbar.vala @@ -109,4 +109,9 @@ public class MainToolbar : Hdy.Leaflet { public void add_conversation_actions(Components.ConversationActions actions) { conversation_header.add_conversation_actions(actions); } + + public void show_main_menu() { + this.main_menu_button.clicked(); + } + } diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala index 3d893d43..37172593 100644 --- a/src/client/composer/composer-widget.vala +++ b/src/client/composer/composer-widget.vala @@ -1,6 +1,6 @@ /* * Copyright © 2016 Software Freedom Conservancy Inc. - * Copyright © 2017-2020 Michael Gratton + * Copyright © 2017-2021 Michael Gratton * * This software is licensed under the GNU Lesser General Public License * (version 2.1 or later). See the COPYING file in this distribution. @@ -144,6 +144,7 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { private const ActionEntry[] ACTIONS = { { Action.Edit.COPY, on_copy }, { Action.Window.CLOSE, on_close }, + { Action.Window.SHOW_MENU, on_show_window_menu }, { ACTION_ADD_ATTACHMENT, on_add_attachment }, { ACTION_ADD_ORIGINAL_ATTACHMENTS, on_pending_attachments }, { ACTION_CLOSE, on_close }, @@ -2440,6 +2441,16 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface { conditional_close(this.container is Window); } + private void on_show_window_menu() { + Application.MainWindow main = null; + if (this.container != null) { + main = this.container.top_window as Application.MainWindow; + } + if (main != null) { + main.show_window_menu(); + } + } + private void on_discard() { if (this.container is Window) { conditional_close(true); diff --git a/ui/gtk/help-overlay.ui b/ui/gtk/help-overlay.ui index 951db785..af657451 100644 --- a/ui/gtk/help-overlay.ui +++ b/ui/gtk/help-overlay.ui @@ -1,526 +1,532 @@ - + + + + True + conversation + Conversation Shortcuts - + + True + Actions + + True - 12 - conversation - Conversation Shortcuts - - - True - Actions - - - True - New conversation - <primary>N - - - - - True - Reply to sender - <primary>R - - - - - True - Reply to all - <primary><Shift>R - - - - - True - Forward - <primary>L - - - - - True - Un-mark/mark read - <primary>U <primary><Shift>U - - - - - True - Mark/un-mark starred - <primary>D <primary><Shift>D - - - - - True - Archive conversations - <primary>K - - - - - True - Move conversations - <primary>M - - - - - True - Label conversations - <primary>B - - - - - True - Trash conversations - Delete BackSpace - - - - - True - Junk conversations - <primary>J - - - - - True - Delete conversations - <Shift>Delete <Shift>BackSpace - - - - - - - True - Search - - - True - Search for conversations - <primary>S - - - - - True - Find in current conversation - <primary>F - - - - - - - - True - Undo - - - True - Undo the last action - <primary>Z - - - - - True - Redo the last action - <primary><Shift>Z - - - - - - - True - View - - - True - Zoom in - <primary>plus - - - - - True - Zoom out - <primary>minus - - - - - True - Reset zoom - <primary>0 - - - - - - - True - General - - - True - Show help - F1 - - - - - True - Show keyboard shortcuts - <Primary>question - - - - - True - Open a new window - <primary><Shift>N - - - - - True - Close the current window - <primary>W - - - - - True - Quit the application - <primary>Q - - - - - - - True - Keyboard navigation - - - True - Go to next/previous pane - <Alt>Right <Alt>Left - - - - - True - Select next/previous conversation - <primary>period <primary>comma - - - - - True - Focus next/previous message - space <shift>space - - - - - + New conversation + <primary>N + + + + + True + Reply to sender + <primary>R + + + + + True + Reply to all + <primary><Shift>R + + + + + True + Forward + <primary>L + + + + + True + Un-mark/mark read + <primary>U <primary><Shift>U + + + + + True + Mark/un-mark starred + <primary>D <primary><Shift>D + + + + + True + Archive conversations + <primary>K + + + + + True + Move conversations + <primary>M + + + + + True + Label conversations + <primary>B + + + + + True + Trash conversations + Delete BackSpace + + + + + True + Junk conversations + <primary>J + + + + + True + Delete conversations + <Shift>Delete <Shift>BackSpace + + + - + + True + Search + + True - single-key - Single-key Shortcuts + Search for conversations + <primary>S + + + + + True + Find in current conversation + <primary>F + + + + - + + True + Undo + + True - composer - Composer Shortcuts - - - True - Actions - - - True - Send - <primary>Return - - - - - True - Add attachment - <primary>T - - - - - True - Detach the composer - <primary>D - - - - - - - True - General - - - True - Close composer window - <primary>W Escape - - - - - True - Detach composer window - <primary>D - - - - - True - Editing - - - True - Move selection to the clipboard - <primary>X - - - - - True - Copy selection to clipboard - <primary>C - - - - - True - Paste from the clipboard - <primary>V - - - - - True - Quote text - <primary>bracketleft - - - - - True - Unquote text - <primary>bracketright - - - - - - - True - Rich text editing - - - True - Paste without formatting - <primary><shift>V - - - - - True - Bold text - <primary>B - - - - - True - Italicize text - <primary>I - - - - - True - Underline text - <primary>U - - - - - True - Strike text - <primary>K - - - - - True - Remove formatting - <primary>space - - - - - True - Insert an image - <primary>I - - - - - True - Insert a link - <primary>L - - - - - + Undo the last action + <primary>Z + + + + + True + Redo the last action + <primary><Shift>Z + + + - + + + True + View + + + True + Zoom in + <primary>plus + + + + + True + Zoom out + <primary>minus + + + + + True + Reset zoom + <primary>0 + + + + + + + + + True + composer + Composer Shortcuts + + + True + Actions + + + True + Send + <primary>Return + + + + + True + Add attachment + <primary>T + + + + + True + Detach the composer + <primary>D + + + + + + + True + General + + + True + Close composer window + <primary>W Escape + + + + + True + Detach composer window + <primary>D + + + + + True + Editing + + + True + Move selection to the clipboard + <primary>X + + + + + True + Copy selection to clipboard + <primary>C + + + + + True + Paste from the clipboard + <primary>V + + + + + True + Quote text + <primary>bracketleft + + + + + True + Unquote text + <primary>bracketright + + + + + + + True + Rich text editing + + + True + Paste without formatting + <primary><shift>V + + + + + True + Bold text + <primary>B + + + + + True + Italicize text + <primary>I + + + + + True + Underline text + <primary>U + + + + + True + Strike text + <primary>K + + + + + True + Remove formatting + <primary>space + + + + + True + Insert an image + <primary>I + + + + + True + Insert a link + <primary>L + + + + + + + + + True + application + Application Shortcuts + + + True + General + + + True + Show help + F1 + + + + + True + Show keyboard shortcuts + <Primary>question + + + + + True + Open a new window + <primary><Shift>N + + + + + True + Close the current window + <primary>W + + + + + True + Quit the application + <primary>Q + + + + + + + True + Keyboard navigation + + + True + Go to next/previous pane + <Alt>Right <Alt>Left + + + + + True + Select next/previous conversation + <primary>period <primary>comma + + + + + True + Focus next/previous message + space <shift>space + + + + + + + + + True + single-key + Single-key Shortcuts + + + True + Single-key shortcuts (if enabled) + + + True + + + + + True + Reply to sender + R + + + + + True + Reply to all + A + + + + + True + Forward + F + + + + + True + Un-mark/mark read + <Shift>U <Shift>I + + + + + True + Mark/un-mark starred + S + + + + + True + Archive conversations + E + + + + + + + True + + + True + + + + + True + Move conversations + V + + + + + True + Label conversations + L + + + + + True + Junk conversations + exclam + + + + + True + Delete conversations + numbersign + + + + + True + Find in current conversation + slash + + + + + True + Select next/previous conversations + J K + + + + + + +