Added settings and implemented restoring of window size.

This commit is contained in:
The Wobbler 2024-12-23 17:12:21 +01:00
parent 99934e73b7
commit 6aae95c865
6 changed files with 36 additions and 1 deletions

View file

@ -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)