[gnome-terminal/wip/fmuellner/headerbar: 6/6] window: Expose more actions in primary menu



commit 414e5f5762938365c94fc0f9a861afca0ad3bca9
Author: Florian Müllner <fmuellner gnome org>
Date:   Fri Nov 2 01:08:56 2018 +0100

    window: Expose more actions in primary menu
    
    Unlike the old app menu, the primary window menu doesn't have to limit
    itself to infrequently used application actions. So expose a couple
    more of the available actions, so that the headerbar can fully replace
    the traditional menubar for the majority of users.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756798

 src/terminal-headermenu.ui | 42 ++++++++++++++++++++++++++++++++++++++++++
 src/terminal-window.c      | 12 ++++++++++++
 2 files changed, 54 insertions(+)
---
diff --git a/src/terminal-headermenu.ui b/src/terminal-headermenu.ui
index 156fa7a3..b6956f97 100644
--- a/src/terminal-headermenu.ui
+++ b/src/terminal-headermenu.ui
@@ -17,7 +17,49 @@
 -->
 <interface>
   <menu id="headermenu">
+    <section>
+      <attribute name="display-hint">horizontal-buttons</attribute>
+      <item>
+        <attribute name="label" translatable="yes">Zoom _Out</attribute>
+        <attribute name="verb-icon">zoom-out-symbolic</attribute>
+        <attribute name="action">win.zoom-out</attribute>
+      </item>
+      <item>
+        <attribute name="label">100%</attribute>
+        <attribute name="action">win.zoom-normal</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Zoom _In</attribute>
+        <attribute name="verb-icon">zoom-in-symbolic</attribute>
+        <attribute name="action">win.zoom-in</attribute>
+      </item>
+    </section>
     <section id="new-terminal-section" />
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">_Fullscreen</attribute>
+        <attribute name="action">win.enter-fullscreen</attribute>
+      </item>
+      <submenu>
+        <attribute name="label" translatable="yes">_Advanced</attribute>
+        <section>
+          <item>
+            <attribute name="label" translatable="yes">_Reset</attribute>
+            <attribute name="action">win.reset</attribute>
+            <attribute name="target" type="b">false</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">Reset and _Clear</attribute>
+            <attribute name="action">win.reset</attribute>
+            <attribute name="target" type="b">true</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">_Inspector</attribute>
+            <attribute name="action">win.inspector</attribute>
+          </item>
+        </section>
+      </submenu>
+    </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Preferences</attribute>
diff --git a/src/terminal-window.c b/src/terminal-window.c
index 7ed6b86f..4dc86c02 100644
--- a/src/terminal-window.c
+++ b/src/terminal-window.c
@@ -1048,6 +1048,17 @@ action_copy_hyperlink_cb (GSimpleAction *action,
   gtk_clipboard_set_text (priv->clipboard, info->hyperlink, -1);
 }
 
+static void
+action_enter_fullscreen_cb (GSimpleAction *action,
+                            GVariant      *parameter,
+                            gpointer       user_data)
+{
+  TerminalWindow *window = user_data;
+
+  g_action_group_change_action_state (G_ACTION_GROUP (window), "fullscreen",
+                                      g_variant_new_boolean (TRUE));
+}
+
 static void
 action_leave_fullscreen_cb (GSimpleAction *action,
                             GVariant      *parameter,
@@ -2044,6 +2055,7 @@ terminal_window_init (TerminalWindow *window)
     { "copy-hyperlink",      action_copy_hyperlink_cb,   NULL,   NULL, NULL },
     { "copy-match",          action_copy_match_cb,       NULL,   NULL, NULL },
     { "edit-preferences",    action_edit_preferences_cb, NULL,   NULL, NULL },
+    { "enter-fullscreen",    action_enter_fullscreen_cb, NULL,   NULL, NULL },
     { "find",                action_find_cb,             NULL,   NULL, NULL },
     { "find-backward",       action_find_backward_cb,    NULL,   NULL, NULL },
     { "find-clear",          action_find_clear_cb,       NULL,   NULL, NULL },


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