desktop_app/main.py
2025-09-26 03:09:28 +03:00

37 lines
1.0 KiB
Python

from PySide6.QtWidgets import QApplication, QMainWindow
from PySide6.QtGui import QIcon
from app.controllers.main_controller import MainController
from app.core.theme import theme_manager
import app.core.config as config
import sys
class MainWindow(QMainWindow):
def __init__(self):
super().__init__()
self.setWindowTitle(config.APP_HEADER)
self.setMinimumSize(400, 650)
self.controller = MainController()
self.setCentralWidget(self.controller)
theme_manager.theme_changed.connect(self.apply_theme)
self.apply_theme(theme_manager.get_theme())
def apply_theme(self, theme):
if theme == "dark":
self.setStyleSheet("background-color: #2e2e2e;")
else:
self.setStyleSheet("background-color: #f0f0f0;")
def main():
app = QApplication(sys.argv)
app.setWindowIcon(QIcon("app/icons/logo3.png"))
window = MainWindow()
window.show()
sys.exit(app.exec())
if __name__ == "__main__":
main()