[geary/wip/743960-split-header-2] Keep app menu on the right end of headerbar
- From: Robert Schroll <rschroll src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [geary/wip/743960-split-header-2] Keep app menu on the right end of headerbar
- Date: Wed, 4 Mar 2015 06:23:29 +0000 (UTC)
commit 91be877bf3266be6ce1a551ad39ccf30affbed8b
Author: Robert Schroll <rschroll gmail com>
Date: Tue Mar 3 23:42:45 2015 -0500
Keep app menu on the right end of headerbar
This requires the composer header bar having an app menu button that we
can turn on as needed.
src/client/components/main-toolbar.vala | 20 ++++++++++----------
src/client/composer/composer-headerbar.vala | 18 +++++++++++++++++-
2 files changed, 27 insertions(+), 11 deletions(-)
---
diff --git a/src/client/components/main-toolbar.vala b/src/client/components/main-toolbar.vala
index 66e5fde..bfc48a0 100644
--- a/src/client/components/main-toolbar.vala
+++ b/src/client/components/main-toolbar.vala
@@ -84,15 +84,7 @@ public class MainToolbar : Gtk.Box {
#if !GTK_3_12
folder_header.add_end(empty);
folder_header.add_end(search);
-#endif
- // Application button. If we exported an app menu, we don't need this.
- if (!Gtk.Settings.get_default().gtk_shell_shows_app_menu) {
- insert.clear();
- insert.add(folder_header.create_menu_button("emblem-system-symbolic",
- application_menu, GearyController.ACTION_GEAR_MENU));
- folder_header.add_end(folder_header.create_pill_buttons(insert));
- }
-#if GTK_3_12
+#else
folder_header.add_end(search);
folder_header.add_end(empty);
#endif
@@ -131,7 +123,15 @@ public class MainToolbar : Gtk.Box {
#if !GTK_3_12
conversation_header.add_end(archive_trash_delete);
conversation_header.add_end(undo);
-#else
+#endif
+ // Application button. If we exported an app menu, we don't need this.
+ if (!Gtk.Settings.get_default().gtk_shell_shows_app_menu) {
+ insert.clear();
+ insert.add(conversation_header.create_menu_button("emblem-system-symbolic",
+ application_menu, GearyController.ACTION_GEAR_MENU));
+ conversation_header.add_end(conversation_header.create_pill_buttons(insert));
+ }
+#if GTK_3_12
conversation_header.add_end(undo);
conversation_header.add_end(archive_trash_delete);
#endif
diff --git a/src/client/composer/composer-headerbar.vala b/src/client/composer/composer-headerbar.vala
index e083c70..5e1a145 100644
--- a/src/client/composer/composer-headerbar.vala
+++ b/src/client/composer/composer-headerbar.vala
@@ -86,9 +86,25 @@ public class ComposerHeaderbar : PillHeaderbar {
#if !GTK_3_12
add_end(send_button);
add_end(close_buttons);
-#endif
add_end(detach_end);
+#endif
+ // Application button for when taking over main header bar. If we exported an app menu,
+ // we don't need this.
+ if (!Gtk.Settings.get_default().gtk_shell_shows_app_menu) {
+ Gtk.Menu application_menu = (Gtk.Menu) GearyApplication.instance.ui_manager.get_widget(
+ "/ui/ToolbarMenu");
+ application_menu.foreach(GtkUtil.show_menuitem_accel_labels);
+ Gtk.Button menu_button = create_menu_button("emblem-system-symbolic", application_menu,
+ GearyController.ACTION_GEAR_MENU);
+ add_end(menu_button);
+ bind_property("state", menu_button, "visible", BindingFlags.SYNC_CREATE,
+ (binding, source_value, ref target_value) => {
+ target_value = (state == ComposerWidget.ComposerState.NEW);
+ return true;
+ });
+ }
#if GTK_3_12
+ add_end(detach_end);
add_end(close_buttons);
add_end(send_button);
#endif
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]