[geary/wip/3.32-ux: 3/5] Merge empty menu into main menu



commit 3ccd977cf8b36b11e3aa8e28b6efddbdcd050b2a
Author: p3732 <p3732 users noreply github com>
Date:   Sun Oct 28 02:15:58 2018 +0100

    Merge empty menu into main menu
    
    Remove empty menu and move entries to new main menu.

 src/client/components/main-toolbar.vala |  6 +-----
 ui/main-toolbar-menus.ui                | 21 ++++++++++-----------
 ui/main-toolbar.ui                      | 21 ---------------------
 3 files changed, 11 insertions(+), 37 deletions(-)
---
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 30049df1..95cd69cc 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -36,8 +36,6 @@ public class MainToolbar : Gtk.Box {
     [GtkChild]
     private Gtk.HeaderBar folder_header;
     [GtkChild]
-    private Gtk.MenuButton empty_menu_button;
-    [GtkChild]
     private Gtk.ToggleButton search_conversations_button;
     [GtkChild]
     private Gtk.MenuButton main_menu_button;
@@ -104,14 +102,12 @@ public class MainToolbar : Gtk.Box {
         this.bind_property("show-close-button-right", this.conversation_header, "show-close-button",
             BindingFlags.SYNC_CREATE);
 
-        // Assemble the empty/mark menus
+        // Assemble the main/mark menus
         Gtk.Builder builder = new Gtk.Builder.from_resource("/org/gnome/Geary/main-toolbar-menus.ui");
-        MenuModel empty_menu = (MenuModel) builder.get_object("empty_menu");
         MenuModel main_menu = (MenuModel) builder.get_object("main_menu");
         MenuModel mark_menu = (MenuModel) builder.get_object("mark_message_menu");
 
         // Setup folder header elements
-        this.empty_menu_button.popover = new Gtk.Popover.from_model(null, empty_menu);
         this.main_menu_button.popover = new Gtk.Popover.from_model(null, main_menu);
         this.bind_property("search-open", this.search_conversations_button, "active",
             BindingFlags.SYNC_CREATE | BindingFlags.BIDIRECTIONAL);
diff --git a/ui/main-toolbar-menus.ui b/ui/main-toolbar-menus.ui
index 19cc9971..b10d74fe 100644
--- a/ui/main-toolbar-menus.ui
+++ b/ui/main-toolbar-menus.ui
@@ -1,16 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <interface>
-  <menu id="empty_menu">
-    <item>
-      <attribute name="label" translatable="yes">Empty _Spam…</attribute>
-      <attribute name="action">win.empty-spam</attribute>
-    </item>
-    <item>
-      <attribute name="label" translatable="yes">Empty _Trash…</attribute>
-      <attribute name="action">win.empty-trash</attribute>
-    </item>
-  </menu>
-
   <menu id="mark_message_menu">
     <item>
       <attribute name="label" translatable="yes">Mark as _Read</attribute>
@@ -38,6 +27,16 @@
     </item>
   </menu>
   <menu id="main_menu">
+    <section>
+      <item>
+        <attribute name="label" translatable="yes">Empty _Spam…</attribute>
+        <attribute name="action">win.empty-spam</attribute>
+      </item>
+      <item>
+        <attribute name="label" translatable="yes">Empty _Trash…</attribute>
+        <attribute name="action">win.empty-trash</attribute>
+      </item>
+    </section>
     <section>
       <item>
         <attribute name="label" translatable="yes">_Accounts</attribute>
diff --git a/ui/main-toolbar.ui b/ui/main-toolbar.ui
index 5d33a085..63e37e08 100644
--- a/ui/main-toolbar.ui
+++ b/ui/main-toolbar.ui
@@ -63,27 +63,6 @@
             <property name="position">3</property>
           </packing>
         </child>
-        <child>
-          <object class="GtkMenuButton" id="empty_menu_button">
-            <property name="visible">True</property>
-            <property name="can_focus">True</property>
-            <property name="focus_on_click">False</property>
-            <property name="receives_default">False</property>
-            <property name="tooltip_text" translatable="yes">Empty Spam or Trash folders</property>
-            <property name="always_show_image">True</property>
-            <child>
-              <object class="GtkImage" id="empty_menu_image">
-                <property name="visible">True</property>
-                <property name="can_focus">False</property>
-                <property name="icon_name">edit-clear-all-symbolic</property>
-              </object>
-            </child>
-          </object>
-          <packing>
-            <property name="pack_type">end</property>
-            <property name="position">4</property>
-          </packing>
-        </child>
         <child>
           <object class="GtkMenuButton" id="main_menu_button">
             <property name="visible">True</property>


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