[devhelp] Window: rename "gear menu" -> "window menu"



commit 982ad6d74c0a8df90f9eaa812bb0189b7454091a
Author: Sébastien Wilmet <swilmet gnome org>
Date:   Thu Feb 1 18:04:08 2018 +0100

    Window: rename "gear menu" -> "window menu"
    
    The icon was initially a gear but has been changed a long time ago to an
    "hamburger menu" (three horizontal bars). Since I don't like fast foods
    and hamburgers, I prefer to call that "window menu", to contrast it with
    "app menu".
    
    Improve also the GAction name.

 src/dh-app.c     |    2 +-
 src/dh-window.c  |   15 ++++++++-------
 src/dh-window.ui |   10 +++++-----
 3 files changed, 14 insertions(+), 13 deletions(-)
---
diff --git a/src/dh-app.c b/src/dh-app.c
index 12e9eda..8b2583c 100644
--- a/src/dh-app.c
+++ b/src/dh-app.c
@@ -295,7 +295,7 @@ setup_accelerators (GtkApplication *app)
         gtk_application_set_accels_for_action (app, "win.show-sidebar", accels);
 
         accels[0] = "F10";
-        gtk_application_set_accels_for_action (app, "win.gear-menu", accels);
+        gtk_application_set_accels_for_action (app, "win.show-window-menu", accels);
 
         accels[0] = "<Alt>Right";
         accels[1] = "Forward";
diff --git a/src/dh-window.c b/src/dh-window.c
index 2cb7e3c..76c8eb1 100644
--- a/src/dh-window.c
+++ b/src/dh-window.c
@@ -29,12 +29,12 @@
 #include "dh-util.h"
 
 typedef struct {
-        GMenuModel *gear_app_menu;
+        GMenuModel *window_menu_plus_app_menu;
         GtkPaned *hpaned;
         DhSidebar *sidebar;
         GtkNotebook *notebook;
         GtkHeaderBar *header_bar;
-        GtkMenuButton *gear_menu_button;
+        GtkMenuButton *window_menu_button;
         GtkWidget *grid_sidebar;
         GtkSearchBar *search_bar;
         GtkSearchEntry *search_entry;
@@ -457,8 +457,8 @@ add_action_entries (DhWindow *window)
         g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (property_action));
         g_object_unref (property_action);
 
-        property_action = g_property_action_new ("gear-menu",
-                                                 priv->gear_menu_button,
+        property_action = g_property_action_new ("show-window-menu",
+                                                 priv->window_menu_button,
                                                  "active");
         g_action_map_add_action (G_ACTION_MAP (window), G_ACTION (property_action));
         g_object_unref (property_action);
@@ -520,7 +520,8 @@ dh_window_init (DhWindow *window)
 
         app = GTK_APPLICATION (g_application_get_default ());
         if (!gtk_application_prefers_app_menu (app)) {
-                gtk_menu_button_set_menu_model (priv->gear_menu_button, priv->gear_app_menu);
+                gtk_menu_button_set_menu_model (priv->window_menu_button,
+                                                priv->window_menu_plus_app_menu);
         }
 
         /* handle settings */
@@ -555,9 +556,9 @@ dh_window_class_init (DhWindowClass *klass)
         /* Bind class to template */
         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, gear_app_menu);
+        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, header_bar);
-        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, gear_menu_button);
+        gtk_widget_class_bind_template_child_private (widget_class, DhWindow, window_menu_button);
         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, notebook);
diff --git a/src/dh-window.ui b/src/dh-window.ui
index c2635b5..33b9cad 100644
--- a/src/dh-window.ui
+++ b/src/dh-window.ui
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
   <!-- interface-requires gtk+ 3.8 -->
-  <menu id="gear_menu">
+  <menu id="window_menu_simple">
     <section>
       <item>
         <attribute name="label" translatable="yes">_Side Panel</attribute>
@@ -33,7 +33,7 @@
       </item>
     </section>
   </menu>
-  <menu id="gear_app_menu">
+  <menu id="window_menu_plus_app_menu">
     <section>
       <item>
         <attribute name="label" translatable="yes">New _Window</attribute>
@@ -158,17 +158,17 @@
           </packing>
         </child>
         <child>
-          <object class="GtkMenuButton" id="gear_menu_button">
+          <object class="GtkMenuButton" id="window_menu_button">
             <property name="visible">True</property>
             <property name="valign">center</property>
             <property name="can_focus">False</property>
-            <property name="menu_model">gear_menu</property>
+            <property name="menu_model">window_menu_simple</property>
             <property name="use_popover">True</property>
             <style>
               <class name="image-button"/>
             </style>
             <child>
-              <object class="GtkImage" id="gear_image">
+              <object class="GtkImage" id="window_menu_image">
                 <property name="visible">True</property>
                 <property name="icon_size">1</property>
                 <property name="icon_name">open-menu-symbolic</property>


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