forked from Wobbl/Wobuzz
Added settings and implemented restoring of window size.
This commit is contained in:
parent
99934e73b7
commit
6aae95c865
6 changed files with 36 additions and 1 deletions
|
@ -1,7 +1,14 @@
|
|||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
from pathlib import Path
|
||||
|
||||
|
||||
class Utils:
|
||||
home_path = str(Path.home())
|
||||
wobuzz_location = os.path.dirname(os.path.abspath(__file__))
|
||||
settings_location = f"{wobuzz_location}/settings.json"
|
||||
|
||||
def __init__(self, app):
|
||||
self.app = app
|
||||
|
||||
|
@ -22,4 +29,10 @@ class Utils:
|
|||
|
||||
return output
|
||||
|
||||
def on_close(self, event):
|
||||
self.app.settings.window_size = (self.app.gui.window.width(), self.app.gui.window.height())
|
||||
self.app.settings.window_maximized = self.app.gui.window.isMaximized()
|
||||
|
||||
self.app.settings.save(self.settings_location)
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue