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



commit 1732107de61c81756486dc459074d2f539cd4bd8
Author: Florian Müllner <fmuellner gnome org>
Date:   Mon Nov 5 23:24:50 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 | 71 ++++++++++++++++++++++++++++++++++++++++++++++
 src/terminal-window.c      | 12 ++++++++
 2 files changed, 83 insertions(+)
---
diff --git a/src/terminal-headermenu.ui b/src/terminal-headermenu.ui
index 6ce310c4..74f7c7f1 100644
--- a/src/terminal-headermenu.ui
+++ b/src/terminal-headermenu.ui
@@ -17,13 +17,84 @@
 -->
 <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>
       <item>
         <attribute name="label" translatable="yes">New _Window</attribute>
         <attribute name="action">win.new-terminal</attribute>
         <attribute name="target" type="(ss)">('window', 'current')</attribute>
       </item>
+      <item>
+        <attribute name="label" translatable="yes">_Full Screen</attribute>
+        <attribute name="action">win.enter-fullscreen</attribute>
+      </item>
+    </section>
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Read-_Only</attribute>
+        <attribute name="action">win.read-only</attribute>
+      </item>
       <section id="set-profile-section" />
+      <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 C_lear</attribute>
+            <attribute name="action">win.reset</attribute>
+            <attribute name="target" type="b">true</attribute>
+          </item>
+        </section>
+        <section>
+          <item>
+            <attribute name="label" translatable="yes">_1. 80×24</attribute>
+            <attribute name="action">win.size-to</attribute>
+            <attribute name="target" type="(uu)">(80, 24)</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">_2. 80×43</attribute>
+            <attribute name="action">win.size-to</attribute>
+            <attribute name="target" type="(uu)">(80, 43)</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">_3. 132×24</attribute>
+            <attribute name="action">win.size-to</attribute>
+            <attribute name="target" type="(uu)">(132, 24)</attribute>
+          </item>
+          <item>
+            <attribute name="label" translatable="yes">_4. 132×43</attribute>
+            <attribute name="action">win.size-to</attribute>
+            <attribute name="target" type="(uu)">(132, 43)</attribute>
+          </item>
+        </section>
+        <section>
+          <item>
+            <attribute name="label" translatable="yes">_Inspector</attribute>
+            <attribute name="action">win.inspector</attribute>
+            <attribute name="hidden-when">action-disabled</attribute>
+          </item>
+        </section>
+      </submenu>
     </section>
     <section>
       <item>
diff --git a/src/terminal-window.c b/src/terminal-window.c
index f6dce67d..10b5a6ac 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,
@@ -2047,6 +2058,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]