Commit 1acde1b8 authored by Bilal Elmoussaoui's avatar Bilal Elmoussaoui Committed by Jeremy Bicha
parent 6430bc28
......@@ -14,14 +14,9 @@
</section>
<section>
<item>
<attribute name="label" translatable="yes">_About</attribute>
<attribute name="label" translatable="yes">_About Tweaks</attribute>
<attribute name="action">app.about</attribute>
</item>
<item>
<attribute name="label" translatable="yes">_Quit</attribute>
<attribute name="action">app.quit</attribute>
<attribute name="accel">&lt;Primary&gt;q</attribute>
</item>
</item>
</section>
</menu>
</interface>
......@@ -34,14 +34,6 @@ class GnomeTweaks(Gtk.Application):
def do_startup(self):
Gtk.Application.do_startup(self)
self.builder = Gtk.Builder()
assert(os.path.exists(gtweak.PKG_DATA_DIR))
filename = os.path.join(gtweak.PKG_DATA_DIR, 'shell.ui')
self.builder.add_from_file(filename)
appmenu = self.builder.get_object('appmenu')
self.set_app_menu(appmenu)
reset_action = Gio.SimpleAction.new("reset", None)
reset_action.connect("activate", self.reset_cb)
self.add_action(reset_action)
......@@ -58,10 +50,6 @@ class GnomeTweaks(Gtk.Application):
about_action.connect("activate", self.about_cb)
self.add_action(about_action)
quit_action = Gio.SimpleAction.new("quit", None)
quit_action.connect("activate", self.quit_cb)
self.add_action(quit_action)
def reset_cb(self, action, parameter):
dialog = Gtk.MessageDialog(self.win, 0, Gtk.MessageType.QUESTION,
Gtk.ButtonsType.OK_CANCEL, _("Reset to Defaults"))
......
......@@ -4,8 +4,8 @@
import os.path
from gi.repository import Gtk, Gdk
from gi.repository import Gtk, Gdk, Gio
import gtweak
import gtweak.tweakmodel
from gtweak.tweakmodel import string_for_search
......@@ -84,6 +84,19 @@ class Window(Gtk.ApplicationWindow):
lbl.get_style_context().add_class("title")
left_header.set_custom_title(lbl)
self.builder = Gtk.Builder()
assert(os.path.exists(gtweak.PKG_DATA_DIR))
filename = os.path.join(gtweak.PKG_DATA_DIR, 'shell.ui')
self.builder.add_from_file(filename)
appmenu = self.builder.get_object('appmenu')
menu_btn = Gtk.MenuButton()
icon = Gtk.Image.new_from_gicon(Gio.ThemedIcon(name="open-menu-symbolic"),
Gtk.IconSize.BUTTON)
menu_btn.set_image(icon)
menu_btn.set_menu_model(appmenu)
right_header.pack_end(menu_btn)
header.pack_start(left_header, False, False, 0)
header.pack_start(Gtk.Separator(orientation=Gtk.Orientation.VERTICAL), False, False, 0)
header.pack_start(right_header, True, True, 0)
......
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