[gnome-terminal/wip/fmuellner/headerbar: 6/8] accels: Add shortcut for toggling the primary menu
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-terminal/wip/fmuellner/headerbar: 6/8] accels: Add shortcut for toggling the primary menu
- Date: Sun, 4 Nov 2018 00:01:34 +0000 (UTC)
commit 8f1161b87606b24d1d0c9b71fbe88c25b63a7af1
Author: Florian Müllner <fmuellner gnome org>
Date: Sun Nov 4 00:00:50 2018 +0100
accels: Add shortcut for toggling the primary menu
When the headerbar is enabled, the primary menu is an important
entry point. Make it more accessible by adding a dedicated
shortcut.
https://bugzilla.gnome.org/show_bug.cgi?id=756798
src/org.gnome.Terminal.gschema.xml | 4 ++++
src/terminal-accels.c | 2 ++
src/terminal-headerbar.ui | 1 +
src/terminal-window.c | 1 +
4 files changed, 8 insertions(+)
---
diff --git a/src/org.gnome.Terminal.gschema.xml b/src/org.gnome.Terminal.gschema.xml
index fc1602f2..988b3b4d 100644
--- a/src/org.gnome.Terminal.gschema.xml
+++ b/src/org.gnome.Terminal.gschema.xml
@@ -456,6 +456,10 @@
<default>'disabled'</default>
<summary>Keyboard shortcut to toggle the visibility of the menubar</summary>
</key>
+ <key name="header-menu" type="s">
+ <default>'<Control>F10'</default>
+ <summary>Keyboard shortcut to toggle the primary menu</summary>
+ </key>
<key name="read-only" type="s">
<default>'disabled'</default>
<summary>Keyboard shortcut to toggle the read-only state</summary>
diff --git a/src/terminal-accels.c b/src/terminal-accels.c
index e412180f..76b39397 100644
--- a/src/terminal-accels.c
+++ b/src/terminal-accels.c
@@ -60,6 +60,7 @@
#define KEY_FIND_PREV "find-previous"
#define KEY_FIND_NEXT "find-next"
#define KEY_FULL_SCREEN "full-screen"
+#define KEY_HEADER_MENU "header-menu"
#define KEY_HELP "help"
#define KEY_MOVE_TAB_LEFT "move-tab-left"
#define KEY_MOVE_TAB_RIGHT "move-tab-right"
@@ -153,6 +154,7 @@ static KeyEntry search_entries[] = {
static KeyEntry view_entries[] = {
ENTRY (N_("Hide and Show Menubar"), KEY_TOGGLE_MENUBAR, "menubar-visible", NULL, NULL),
+ ENTRY (N_("Toggle Primary Menu"), KEY_HEADER_MENU, "header-menu", NULL, NULL),
ENTRY (N_("Full Screen"), KEY_FULL_SCREEN, "fullscreen", NULL, NULL),
ENTRY (N_("Zoom In"), KEY_ZOOM_IN, "zoom-in", NULL, NULL),
ENTRY (N_("Zoom Out"), KEY_ZOOM_OUT, "zoom-out", NULL, NULL),
diff --git a/src/terminal-headerbar.ui b/src/terminal-headerbar.ui
index d1bf3ebc..d2589865 100644
--- a/src/terminal-headerbar.ui
+++ b/src/terminal-headerbar.ui
@@ -45,6 +45,7 @@
<property name="focus_on_click">False</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
+ <property name="action-name">win.header-menu</property>
<style>
<class name="image-button"/>
</style>
diff --git a/src/terminal-window.c b/src/terminal-window.c
index e86a2983..79326086 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -2099,6 +2099,7 @@ terminal_window_init (TerminalWindow *window)
/* Actions with state */
{ "active-tab", action_active_tab_set_cb, "i", "@i 0", action_active_tab_state_cb },
{ "encoding", NULL /* changes state */, "s", "'UTF-8'", action_encoding_state_cb },
+ { "header-menu", NULL /* toggles state */, NULL, "false", NULL },
{ "fullscreen", NULL /* toggles state */, NULL, "false", action_fullscreen_state_cb },
{ "menubar-visible", NULL /* toggles state */, NULL, "true", action_menubar_visible_state_cb },
{ "profile", NULL /* changes state */, "s", "''", action_profile_state_cb },
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]