[gnome-text-editor] menus: merge export-menu into primary-menu



commit 8d793d18903c5e39af109153a1189f86142bb479
Author: Christian Hergert <chergert redhat com>
Date:   Tue Jul 20 08:19:29 2021 -0700

    menus: merge export-menu into primary-menu
    
    Fixes #114

 src/editor-window.c  |  5 -----
 src/editor-window.ui |  5 -----
 src/menus.ui         | 44 +++++++++++++++++++-------------------------
 3 files changed, 19 insertions(+), 35 deletions(-)
---
diff --git a/src/editor-window.c b/src/editor-window.c
index a60756d..beb3796 100644
--- a/src/editor-window.c
+++ b/src/editor-window.c
@@ -268,7 +268,6 @@ editor_window_constructed (GObject *object)
   GtkApplication *app;
   EditorSession *session;
   GtkPopover *popover;
-  GMenu *export_menu;
   GMenu *options_menu;
   GMenu *primary_menu;
 
@@ -284,9 +283,6 @@ editor_window_constructed (GObject *object)
                           self->open_menu_popover, "model",
                           G_BINDING_SYNC_CREATE);
 
-  export_menu = gtk_application_get_menu_by_id (GTK_APPLICATION (app), "export-menu");
-  gtk_menu_button_set_menu_model (self->export_menu, G_MENU_MODEL (export_menu));
-
   primary_menu = gtk_application_get_menu_by_id (GTK_APPLICATION (app), "primary-menu");
   gtk_menu_button_set_menu_model (self->primary_menu, G_MENU_MODEL (primary_menu));
 
@@ -396,7 +392,6 @@ editor_window_class_init (EditorWindowClass *klass)
 
   gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/TextEditor/ui/editor-window.ui");
   gtk_widget_class_bind_template_child (widget_class, EditorWindow, empty);
-  gtk_widget_class_bind_template_child (widget_class, EditorWindow, export_menu);
   gtk_widget_class_bind_template_child (widget_class, EditorWindow, is_modified);
   gtk_widget_class_bind_template_child (widget_class, EditorWindow, open_menu_button);
   gtk_widget_class_bind_template_child (widget_class, EditorWindow, open_menu_popover);
diff --git a/src/editor-window.ui b/src/editor-window.ui
index 6e26097..25739d5 100644
--- a/src/editor-window.ui
+++ b/src/editor-window.ui
@@ -95,11 +95,6 @@
                     </child>
                   </object>
                 </child>
-                <child>
-                  <object class="GtkMenuButton" id="export_menu">
-                    <property name="icon-name">document-save-symbolic</property>
-                  </object>
-                </child>
                 <child>
                   <object class="GtkMenuButton" id="options_menu">
                     <property name="icon-name">document-properties-symbolic</property>
diff --git a/src/menus.ui b/src/menus.ui
index d44f8f5..bf84480 100644
--- a/src/menus.ui
+++ b/src/menus.ui
@@ -28,12 +28,31 @@
       </item>
     </section>
     <section>
+      <item>
+        <attribute name="id">copy-all</attribute>
+        <attribute name="label" translatable="yes">_Copy All</attribute>
+        <attribute name="action">page.copy-all</attribute>
+        <attribute name="accel">&lt;primary&gt;&lt;shift&gt;c</attribute>
+      </item>
+      <item>
+        <attribute name="id">discard-changes</attribute>
+        <attribute name="label" translatable="yes">_Discard Changes</attribute>
+        <attribute name="action">page.discard-changes</attribute>
+      </item>
       <item>
         <attribute name="label" translatable="yes">_Find/Replace…</attribute>
         <attribute name="action">page.begin-search</attribute>
         <attribute name="accel">&lt;primary&gt;f</attribute>
       </item>
     </section>
+    <section>
+      <item>
+        <attribute name="id">print</attribute>
+        <attribute name="label" translatable="yes">_Print…</attribute>
+        <attribute name="action">page.print</attribute>
+        <attribute name="accel">&lt;primary&gt;p</attribute>
+      </item>
+    </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Preferences</attribute>
@@ -118,31 +137,6 @@
       </item>
     </section>
   </menu>
-  <menu id="export-menu">
-    <section>
-      <item>
-        <attribute name="id">discard-changes</attribute>
-        <attribute name="label" translatable="yes">_Discard Changes</attribute>
-        <attribute name="action">page.discard-changes</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="id">copy-all</attribute>
-        <attribute name="label" translatable="yes">_Copy All</attribute>
-        <attribute name="action">page.copy-all</attribute>
-        <attribute name="accel">&lt;primary&gt;&lt;shift&gt;c</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="id">print</attribute>
-        <attribute name="label" translatable="yes">_Print…</attribute>
-        <attribute name="action">page.print</attribute>
-        <attribute name="accel">&lt;primary&gt;p</attribute>
-      </item>
-    </section>
-  </menu>
   <menu id="tab-menu">
     <section>
       <item>


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