Skip to content

Commit

Permalink
blueman-manager: Small rework of main ui
Browse files Browse the repository at this point in the history
* Put ApplicationWindow in builder
* Use the Gtk.Grid for all layout
* Drop icon widgets and use icon names
  • Loading branch information
infirit committed Jul 17, 2022
1 parent 200ff1c commit 0295138
Show file tree
Hide file tree
Showing 2 changed files with 145 additions and 194 deletions.
12 changes: 5 additions & 7 deletions blueman/main/Manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,17 @@ def doquit(_a: Gio.SimpleAction, _param: None) -> None:

self.Config = Config("org.blueman.general")

self.builder = Builder("manager-main.ui")

quit_action = Gio.SimpleAction.new("Quit", None)
quit_action.connect("activate", doquit)
self.set_accels_for_action("app.Quit", ["<Ctrl>q", "<Ctrl>w"])
self.add_action(quit_action)

def do_activate(self) -> None:
if not self.window:
self.window = Gtk.ApplicationWindow(application=self, name="BluemanManager", icon_name="blueman",
title=_("Bluetooth Devices"))
self.window = self.builder.get_widget("manager_window", Gtk.ApplicationWindow)
self.window.set_application(self)
w, h, x, y = self.Config["window-properties"]
if w and h:
self.window.resize(w, h)
Expand All @@ -70,10 +72,6 @@ def do_activate(self) -> None:
# Connect to configure event to store new window position and size
self.window.connect("configure-event", self._on_configure)

self.builder = Builder("manager-main.ui")
box = self.builder.get_widget("box", Gtk.Box)
self.window.add(box)

grid = self.builder.get_widget("grid", Gtk.Grid)

toolbar = self.builder.get_widget("toolbar", Gtk.Toolbar)
Expand All @@ -83,7 +81,7 @@ def do_activate(self) -> None:
self.Plugins.load_plugin()

area = MessageArea()
grid.attach(area, 0, 1, 1, 1)
grid.attach(area, 0, 3, 1, 1)

self._applethandlerid: Optional[int] = None

Expand Down
Loading

0 comments on commit 0295138

Please sign in to comment.