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



commit eb4cd094a6c05ba7084f5a108b833a149f0ee584
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 | 74 ++++++++++++++++++++++++++++++++++++++++++++++
 src/terminal-window.c      | 12 ++++++++
 2 files changed, 86 insertions(+)
---
diff --git a/src/terminal-headermenu.ui b/src/terminal-headermenu.ui
index 2c13ae5f..fe70a437 100644
--- a/src/terminal-headermenu.ui
+++ b/src/terminal-headermenu.ui
@@ -17,13 +17,87 @@
 -->
 <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>
+      <submenu>
+        <attribute name="label" translatable="yes">_Set Size</attribute>
+        <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>
+      </submenu>
       <section id="set-profile-section" />
+      <submenu>
+        <attribute name="label" translatable="yes">_Advanced</attribute>
+        <section>
+          <item>
+            <attribute name="label" translatable="yes">Read-_Only</attribute>
+            <attribute name="action">win.read-only</attribute>
+          </item>
+        </section>
+        <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">_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]