diff options
author | Christian Dywan <christian@twotoasts.de> | 2018-09-12 00:48:30 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-12 00:48:30 +0200 |
commit | 1245e9cd5603d0fe6e27c84d4a386bd5c47c9e0f (patch) | |
tree | ea22721f55761e886efc11681c65d9688f1446f6 | |
parent | 2443a320082a7c257bd4c864ec4e184c89227f8c (diff) | |
download | midori-git-1245e9cd5603d0fe6e27c84d4a386bd5c47c9e0f.tar.gz |
Mirror app menu in the window always (#53)
App menus are going to go away:
https://wiki.gnome.org/Design/Whiteboards/AppMenuMigration
-rw-r--r-- | core/browser.vala | 15 | ||||
-rw-r--r-- | ui/browser.ui | 30 | ||||
-rw-r--r-- | ui/menus.ui | 22 | ||||
-rw-r--r-- | ui/navigationbar.ui | 8 |
4 files changed, 24 insertions, 51 deletions
diff --git a/core/browser.vala b/core/browser.vala index a1008755..182a4eaf 100644 --- a/core/browser.vala +++ b/core/browser.vala @@ -55,12 +55,8 @@ namespace Midori { [GtkChild] DownloadButton downloads; [GtkChild] - Gtk.MenuButton profile; - [GtkChild] Gtk.MenuButton app_menu; [GtkChild] - Gtk.Image profile_icon; - [GtkChild] Navigationbar navigationbar; [GtkChild] Gtk.Stack tabs; @@ -126,15 +122,10 @@ namespace Midori { application.set_accels_for_action ("win.tab-zoom(-0.1)", { "<Primary>minus" }); application.set_accels_for_action ("win.tab-zoom(1.0)", { "<Primary>0" }); - profile.menu_model = application.get_menu_by_id ("profile-menu"); - navigationbar.menubutton.menu_model = application.get_menu_by_id ("browser-menu"); + app_menu.menu_model = application.get_menu_by_id ("app-menu"); + navigationbar.menubutton.menu_model = application.get_menu_by_id ("page-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 @@ -266,10 +257,8 @@ namespace Midori { Object (application: app, web_context: app.ephemeral_context ()); - profile.sensitive = false; remove_action ("clear-private-data"); get_style_context ().add_class ("incognito"); - profile_icon.icon_name = "user-not-tracked-symbolic"; } public override bool key_press_event (Gdk.EventKey event) { diff --git a/ui/browser.ui b/ui/browser.ui index a9c9ddb9..669b918b 100644 --- a/ui/browser.ui +++ b/ui/browser.ui @@ -4,7 +4,7 @@ <property name="mode">vertical</property> <widgets> <widget name="scrolled"/> - <widget name="profile"/> + <widget name="app_menu"/> </widgets> </object> <object class="GtkSizeGroup"> @@ -73,41 +73,19 @@ </packing> </child> <child> - <object class="MidoriDownloadButton" id="downloads"> - <property name="valign">center</property> - </object> - <packing> - <property name="pack-type">end</property> - </packing> - </child> - <child> - <object class="GtkMenuButton" id="profile"> + <object class="GtkMenuButton" id="app_menu"> <property name="focus-on-click">no</property> <property name="valign">center</property> + <property name="direction">none</property> <property name="visible">yes</property> - <child> - <object class="GtkImage" id="profile_icon"> - <property name="icon-name">user-info-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="app_menu"> - <property name="focus-on-click">no</property> + <object class="MidoriDownloadButton" id="downloads"> <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> diff --git a/ui/menus.ui b/ui/menus.ui index ae9c7e0b..75d18c4e 100644 --- a/ui/menus.ui +++ b/ui/menus.ui @@ -12,6 +12,16 @@ <attribute name="label" translatable="yes">New P_rivate Browsing Window</attribute> <attribute name="accel"><Primary><Shift>p</attribute> </item> + </section> + <section> + <item> + <attribute name="action">win.clear-private-data</attribute> + <attribute name="hidden-when">action-disabled</attribute> + <attribute name="label" translatable="yes">_Clear private data</attribute> + <attribute name="accel"><Primary><Shift>Delete</attribute> + </item> + </section> + <section> <item> <attribute name="action">win.show-help-overlay</attribute> <attribute name="hidden-when">action-disabled</attribute> @@ -29,17 +39,7 @@ </item> </section> </menu> - <menu id="profile-menu"> - <section> - <item> - <attribute name="action">win.clear-private-data</attribute> - <attribute name="hidden-when">action-disabled</attribute> - <attribute name="label" translatable="yes">_Clear private data</attribute> - <attribute name="accel"><Primary><Shift>Delete</attribute> - </item> - </section> - </menu> - <menu id="browser-menu"> + <menu id="page-menu"> <section> <item> <attribute name="action">win.find</attribute> diff --git a/ui/navigationbar.ui b/ui/navigationbar.ui index 9f69987c..1331e0c1 100644 --- a/ui/navigationbar.ui +++ b/ui/navigationbar.ui @@ -94,8 +94,14 @@ <child> <object class="GtkMenuButton" id="menubutton"> <property name="valign">center</property> - <property name="direction">none</property> <property name="visible">yes</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> |