Skip to content

Commit

Permalink
Save window size
Browse files Browse the repository at this point in the history
  • Loading branch information
Ketok4321 committed Jan 12, 2024
1 parent 05fecb7 commit 93ddf1e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions data/xyz.ketok.Speedtest.gschema.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<schemalist gettext-domain="speedtest">
<schema id="xyz.ketok.Speedtest" path="/xyz/ketok/Speedtest/">
<key name="width" type="i">
<default>650</default>
</key>
<key name="height" type="i">
<default>400</default>
</key>
<key name="theme" type="i">
<default>0</default>
</key>
Expand Down
3 changes: 3 additions & 0 deletions src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,9 @@ def do_activate(self):
self.win = SpeedtestWindow(application=self)
self.win.on_test_end = lambda: self.test_worker.stop_event.set()

self.settings.bind("width", self.win, "default-width", Gio.SettingsBindFlags.DEFAULT)
self.settings.bind("height", self.win, "default-height", Gio.SettingsBindFlags.DEFAULT)

self.win.present()

self.load_backend()
Expand Down

0 comments on commit 93ddf1e

Please sign in to comment.