Either export the app menu or show the gear menu

But not both.

Closes: bgo#720347
This commit is contained in:
Charles Lindsay 2013-12-12 17:17:07 -08:00
parent 8907ebf62d
commit 7abfb64cf8
2 changed files with 14 additions and 5 deletions

View file

@ -428,7 +428,14 @@ public class GearyController : Geary.BaseObject {
error("Unable to parse app_menu.interface: %s", e.message);
}
MenuModel menu = (MenuModel) builder.get_object("app-menu");
GearyApplication.instance.set_app_menu(menu);
// We'd *like* to always export an app menu and just let the shell
// decide whether to display it or not. Unfortunately Mint (Cinnamon,
// I believe) and maybe others will insert a menu bar for your
// application, even if you didn't have one otherwise, if you export
// the app menu. So, we only export it if the shell claims to show it.
if (Gtk.Settings.get_default().gtk_shell_shows_app_menu)
GearyApplication.instance.set_app_menu(menu);
}
private void open_account(Geary.Account account) {

View file

@ -96,10 +96,12 @@ public class MainToolbar : PillToolbar {
search_entry.get_preferred_width(out minimum_width, out natural_width);
search_upgrade_progress_bar.width_request = minimum_width;
// Application button.
insert.clear();
insert.add(create_menu_button("emblem-system-symbolic", application_menu, GearyController.ACTION_GEAR_MENU));
add(create_pill_buttons(insert));
// 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(create_menu_button("emblem-system-symbolic", application_menu, GearyController.ACTION_GEAR_MENU));
add(create_pill_buttons(insert));
}
set_search_placeholder_text(DEFAULT_SEARCH_TEXT);
}