[devhelp/ebassi/window-menu: 1/2] Drop the "simple" menu




commit 81fec791c01223e3f73f96e1dd74c793156695f1
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Mon Apr 12 18:25:50 2021 +0100

    Drop the "simple" menu
    
    The application menu has been dropped from GNOME for a while, now;
    there's no need to have a fallback in place.

 src/dh-window.c  |  9 ---------
 src/dh-window.ui | 36 ++----------------------------------
 2 files changed, 2 insertions(+), 43 deletions(-)
---
diff --git a/src/dh-window.c b/src/dh-window.c
index e09334b3..5ade1fff 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -16,7 +16,6 @@
 typedef struct {
         GtkHeaderBar *header_bar;
         GtkMenuButton *window_menu_button;
-        GMenuModel *window_menu_plus_app_menu;
 
         GtkPaned *hpaned;
         GtkWidget *grid_sidebar;
@@ -73,7 +72,6 @@ dh_window_class_init (DhWindowClass *klass)
         gtk_widget_class_set_template_from_resource (widget_class, "/org/gnome/devhelp/dh-window.ui");
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, header_bar);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, window_menu_button);
-        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, window_menu_plus_app_menu);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, hpaned);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_sidebar);
         gtk_widget_class_bind_template_child_private (widget_class, DhWindow, grid_documents);
@@ -496,7 +494,6 @@ static void
 dh_window_init (DhWindow *window)
 {
         DhWindowPrivate *priv = dh_window_get_instance_private (window);
-        GtkApplication *app;
         DhSettingsApp *settings;
         GSettings *paned_settings;
 
@@ -504,12 +501,6 @@ dh_window_init (DhWindow *window)
 
         add_actions (window);
 
-        app = GTK_APPLICATION (g_application_get_default ());
-        if (!gtk_application_prefers_app_menu (app)) {
-                gtk_menu_button_set_menu_model (priv->window_menu_button,
-                                                priv->window_menu_plus_app_menu);
-        }
-
         settings = dh_settings_app_get_singleton ();
         paned_settings = dh_settings_app_peek_paned_settings (settings);
         g_settings_bind (paned_settings, "position",
diff --git a/src/dh-window.ui b/src/dh-window.ui
index cff68898..3069dcf9 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -1,39 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.8 -->
-  <menu id="window_menu_simple">
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Side Panel</attribute>
-        <attribute name="action">win.show-sidebar</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Print</attribute>
-        <attribute name="action">win.print</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">_Find</attribute>
-        <attribute name="action">win.find</attribute>
-      </item>
-    </section>
-    <section>
-      <item>
-        <attribute name="label" translatable="yes">_Larger Text</attribute>
-        <attribute name="action">win.zoom-in</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">S_maller Text</attribute>
-        <attribute name="action">win.zoom-out</attribute>
-      </item>
-      <item>
-        <attribute name="label" translatable="yes">_Normal Size</attribute>
-        <attribute name="action">win.zoom-default</attribute>
-      </item>
-    </section>
-  </menu>
-  <menu id="window_menu_plus_app_menu">
+  <menu id="window_menu">
     <section>
       <item>
         <attribute name="label" translatable="yes">New _Window</attribute>
@@ -161,7 +129,7 @@
             <property name="visible">True</property>
             <property name="valign">center</property>
             <property name="can_focus">False</property>
-            <property name="menu_model">window_menu_simple</property>
+            <property name="menu_model">window_menu</property>
             <property name="use_popover">True</property>
             <style>
               <class name="image-button"/>


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