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
This commit is contained in:
Michael Gratton 2021-01-27 22:25:28 +11:00
parent f4d3c54110
commit 220eb42e5e
3 changed files with 15 additions and 0 deletions

View file

@ -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();
}

View file

@ -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";

View file

@ -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);