Commit 7a034144 authored by Jeremy Bicha's avatar Jeremy Bicha 🎹

appmenu: Add F10 accelerator to open the menu

parent 9a4595ab
...@@ -27,6 +27,7 @@ class Window(Gtk.ApplicationWindow): ...@@ -27,6 +27,7 @@ class Window(Gtk.ApplicationWindow):
right_box = self.main_content() right_box = self.main_content()
separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL) separator = Gtk.Separator(orientation=Gtk.Orientation.VERTICAL)
self.menu_btn = Gtk.MenuButton()
titlebar = self.titlebar() titlebar = self.titlebar()
self.set_titlebar(titlebar) self.set_titlebar(titlebar)
...@@ -90,12 +91,11 @@ class Window(Gtk.ApplicationWindow): ...@@ -90,12 +91,11 @@ class Window(Gtk.ApplicationWindow):
self.builder.add_from_file(filename) self.builder.add_from_file(filename)
appmenu = self.builder.get_object('appmenu') appmenu = self.builder.get_object('appmenu')
menu_btn = Gtk.MenuButton()
icon = Gtk.Image.new_from_gicon(Gio.ThemedIcon(name="open-menu-symbolic"), icon = Gtk.Image.new_from_gicon(Gio.ThemedIcon(name="open-menu-symbolic"),
Gtk.IconSize.BUTTON) Gtk.IconSize.BUTTON)
menu_btn.set_image(icon) self.menu_btn.set_image(icon)
menu_btn.set_menu_model(appmenu) self.menu_btn.set_menu_model(appmenu)
left_header.pack_end(menu_btn) left_header.pack_end(self.menu_btn)
header.pack_start(left_header, False, False, 0) header.pack_start(left_header, False, False, 0)
header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL), False, False, 0) header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL), False, False, 0)
...@@ -228,6 +228,10 @@ class Window(Gtk.ApplicationWindow): ...@@ -228,6 +228,10 @@ class Window(Gtk.ApplicationWindow):
self.button.set_active(True) self.button.set_active(True)
return True return True
if keyname == 'F10':
self.menu_btn.activate()
return True
return False return False
def _on_list_changed(self, group): def _on_list_changed(self, group):
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment