diff options
-rw-r--r-- | core/app.vala | 5 | ||||
-rw-r--r-- | core/browser.vala | 7 | ||||
-rw-r--r-- | ui/browser.ui | 16 |
3 files changed, 28 insertions, 0 deletions
diff --git a/core/app.vala b/core/app.vala index a23ced7e..1762464b 100644 --- a/core/app.vala +++ b/core/app.vala @@ -85,6 +85,11 @@ namespace Midori { var action = new SimpleAction ("win-new", VariantType.STRING); action.activate.connect (win_new_activated); add_action (action); + + // Unset app menu if not handled by the shell + if (!Gtk.Settings.get_default ().gtk_shell_shows_app_menu){ + app_menu = null; + } } void win_new_activated (Action action, Variant? parameter) { diff --git a/core/browser.vala b/core/browser.vala index 2ee9e175..09c3214c 100644 --- a/core/browser.vala +++ b/core/browser.vala @@ -41,6 +41,8 @@ namespace Midori { [GtkChild] Gtk.MenuButton profile; [GtkChild] + Gtk.MenuButton app_menu; + [GtkChild] Gtk.Image profile_icon; [GtkChild] Gtk.ActionBar navigationbar; @@ -110,6 +112,11 @@ namespace Midori { menubutton.menu_model = application.get_menu_by_id ("browser-menu"); application.bind_busy_property (this, "is-loading"); + // App menu fallback as a button rather than a menu + if (!Gtk.Settings.get_default ().gtk_shell_shows_app_menu) { + app_menu.menu_model = application.get_menu_by_id ("app-menu"); + app_menu.show (); + } }); // Action for switching tabs via Alt+number diff --git a/ui/browser.ui b/ui/browser.ui index 9c5eca5e..d564b258 100644 --- a/ui/browser.ui +++ b/ui/browser.ui @@ -44,6 +44,22 @@ </packing> </child> <child> + <object class="GtkMenuButton" id="app_menu"> + <property name="focus-on-click">no</property> + <property name="valign">center</property> + <child> + <object class="GtkImage"> + <property name="icon-name">view-more-symbolic</property> + <property name="use-fallback">yes</property> + <property name="visible">yes</property> + </object> + </child> + </object> + <packing> + <property name="pack-type">end</property> + </packing> + </child> + <child> <object class="GtkMenuButton" id="profile"> <property name="focus-on-click">no</property> <property name="valign">center</property> |