[geary/mjog/composer-keyboard-fixes: 5/5] client: Show keyboard shortcuts in the composer with the correct section




commit 220eb42e5e99264c490fa1e8c7693ab8b756a6e1
Author: Michael Gratton <mike vee net>
Date:   Wed Jan 27 22:25:28 2021 +1100

    client: Show keyboard shortcuts in the composer with the correct section
    
    Enable keyboard shortcuts shortcut in the composer, ensure the composer
    section is visible when activated (and vice versa).
    
    Fixes #1122

 src/client/application/application-main-window.vala | 7 +++++++
 src/client/client-action.vala                       | 1 +
 src/client/composer/composer-widget.vala            | 7 +++++++
 3 files changed, 15 insertions(+)
---
diff --git a/src/client/application/application-main-window.vala 
b/src/client/application/application-main-window.vala
index 955a8fa78..8af06365b 100644
--- a/src/client/application/application-main-window.vala
+++ b/src/client/application/application-main-window.vala
@@ -41,6 +41,7 @@ public class Application.MainWindow :
 
     private const ActionEntry[] WINDOW_ACTIONS = {
         { Action.Window.CLOSE, on_close },
+        { Action.Window.SHOW_HELP_OVERLAY, on_show_help_overlay },
         { Action.Window.SHOW_MENU, on_show_window_menu },
 
         { ACTION_FIND_IN_CONVERSATION, on_find_in_conversation_action },
@@ -2295,6 +2296,12 @@ public class Application.MainWindow :
         show_window_menu();
     }
 
+    private void on_show_help_overlay() {
+        var overlay = get_help_overlay();
+        overlay.section_name = "conversation";
+        overlay.show();
+    }
+
     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 3204ae89f..168dc9e46 100644
--- a/src/client/client-action.vala
+++ b/src/client/client-action.vala
@@ -44,6 +44,7 @@ namespace Action {
 
         public const string CLOSE = "close";
         public const string SHORTCUT_HELP = "show-help-overlay";
+        public const string SHOW_HELP_OVERLAY = "show-help-overlay";
         public const string SHOW_MENU = "show-menu";
 
 
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index 267e1ffd9..72e7a26c6 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -203,6 +203,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_HELP_OVERLAY, on_show_help_overlay             },
         { Action.Window.SHOW_MENU,         on_show_window_menu              },
         { ACTION_ADD_ATTACHMENT,           on_add_attachment                },
         { ACTION_ADD_ORIGINAL_ATTACHMENTS, on_pending_attachments           },
@@ -2484,6 +2485,12 @@ public class Composer.Widget : Gtk.EventBox, Geary.BaseInterface {
         }
     }
 
+    private void on_show_help_overlay() {
+        var overlay = this.container.top_window.get_help_overlay();
+        overlay.section_name = "composer";
+        overlay.show();
+    }
+
     private void on_discard() {
         if (this.container is Window) {
             conditional_close(true);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]