Merge empty menu into main menu

Remove empty menu and move entries to new main menu.
This commit is contained in:
p3732 2018-10-28 02:15:58 +01:00 committed by Michael James Gratton
parent 161aa2a818
commit 04be9ae321
3 changed files with 11 additions and 37 deletions

View file

@ -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;
@ -91,14 +89,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);

View file

@ -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>

View file

@ -64,27 +64,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>