[gnome-calendar/wip/christopherdavis/remove-appmenu] Retire app-menu



commit f6231fd3379bce135033206e8ee286bb76aa3c27
Author: Christopher Davis <brainblasted disroot org>
Date:   Sun Nov 4 02:09:19 2018 -0500

    Retire app-menu
    
    For https://gitlab.gnome.org/GNOME/Initiatives/issues/4,
    the application menu is being retired, with it's contents
    being moved into the in-window primary window.
    
    When removing a menu, the shortcuts for it's actions (if defined
    in the menu) are also removed. The "Quit" shortcut is now
    defined in src/gcal-window.c.
    
    Related to https://gitlab.gnome.org/GNOME/gnome-calendar/issues/319

 data/ui/menus.ui  | 23 -----------------------
 data/ui/window.ui | 39 +++++++++++++++++++++++++++++++++++++++
 src/gcal-window.c |  1 +
 3 files changed, 40 insertions(+), 23 deletions(-)
---
diff --git a/data/ui/menus.ui b/data/ui/menus.ui
index a1fd8f36..549b5ef3 100644
--- a/data/ui/menus.ui
+++ b/data/ui/menus.ui
@@ -1,28 +1,5 @@
 <?xml version="1.0"?>
 <interface>
-  <menu id="app-menu">
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Calendars</attribute>
-        <attribute name="action">win.show-calendars</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Keyboard Shortcuts</attribute>
-        <attribute name="action">win.show-help-overlay</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">_About</attribute>
-        <attribute name="action">app.about</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">_Quit</attribute>
-        <attribute name="action">app.quit</attribute>
-        <attribute name="accel">&lt;Primary&gt;q</attribute>
-      </item>
-    </section>
-  </menu>
   <menu id="add-source-menu">
     <section>
       <item>
diff --git a/data/ui/window.ui b/data/ui/window.ui
index 63612326..f304b146 100644
--- a/data/ui/window.ui
+++ b/data/ui/window.ui
@@ -395,6 +395,45 @@
             <property name="text" translatable="yes">_Weather</property>
           </object>
         </child>
+
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+          </object>
+        </child>
+
+        <!-- Calendars -->
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.show-calendars</property>
+            <property name="text" translatable="yes">_Calendars</property>
+          </object>
+        </child>
+
+        <child>
+          <object class="GtkSeparator">
+            <property name="visible">True</property>
+          </object>
+        </child>
+
+        <!-- Shortcuts -->
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">win.show-help-overlay</property>
+            <property name="text" translatable="yes">_Keyboard Shortcuts</property>
+          </object>
+        </child>
+
+        <!-- About -->
+        <child>
+          <object class="GtkModelButton">
+            <property name="visible">True</property>
+            <property name="action-name">app.about</property>
+            <property name="text" translatable="yes">_About Calendar</property>
+          </object>
+        </child>
       </object>
     </child>
 
diff --git a/src/gcal-window.c b/src/gcal-window.c
index ffe17473..46ee5301 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -1570,6 +1570,7 @@ gcal_window_init (GcalWindow *self)
   gcal_window_add_accelerator (app, "win.change-view(2)",    "<Ctrl>2");
   gcal_window_add_accelerator (app, "win.change-view(3)",    "<Ctrl>3");
   gcal_window_add_accelerator (app, "win.toggle-search-bar", "<Ctrl>f");
+  gcal_window_add_accelerator (app, "app.quit", "<Ctrl>q");
 }
 
 /**


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