Wobuzz/wobuzz/gui.py

34 lines
871 B
Python
Raw Normal View History

2024-12-20 18:02:59 +01:00
#!/usr/bin/python3
from PyQt6.QtCore import Qt
from PyQt6.QtWidgets import QDockWidget
from .ui.main_window import MainWindow
2024-12-20 18:02:59 +01:00
class GUI:
def __init__(self, app):
self.app = app
2024-12-20 18:02:59 +01:00
self.window = MainWindow()
self.window.addDockWidget(Qt.DockWidgetArea.RightDockWidgetArea, self.app.library.main_library_dock)
self.app.library.main_library_dock.setFeatures(
QDockWidget.DockWidgetFeature.DockWidgetMovable |
QDockWidget.DockWidgetFeature.DockWidgetFloatable
)
if self.app.settings.window_maximized:
self.window.showMaximized()
elif not self.app.settings.window_size is None:
self.window.resize(*self.app.settings.window_size)
self.connect()
2024-12-21 19:00:06 +01:00
self.window.show()
def connect(self):
self.window.closeEvent = self.app.utils.on_close
2024-12-21 19:00:06 +01:00