bouquin/bouquin/main.py
Miguel Jacq 6becae6eac
Some checks failed
Lint / test (push) Waiting to run
Trivy / test (push) Waiting to run
CI / test (push) Has been cancelled
Add .desktop file, icons
2025-11-22 17:09:08 +11:00

33 lines
919 B
Python

from __future__ import annotations
import sys
from pathlib import Path
from PySide6.QtWidgets import QApplication
from PySide6.QtGui import QIcon
from .settings import APP_NAME, APP_ORG, get_settings
from .main_window import MainWindow
from .theme import Theme, ThemeConfig, ThemeManager
from . import strings
def main():
app = QApplication(sys.argv)
app.setApplicationName(APP_NAME)
app.setOrganizationName(APP_ORG)
# Icon
BASE_DIR = Path(__file__).resolve().parent
ICON_PATH = BASE_DIR / "icons" / "bouquin-light.svg"
icon = QIcon(str(ICON_PATH))
app.setWindowIcon(icon)
s = get_settings()
theme_str = s.value("ui/theme", "system")
cfg = ThemeConfig(theme=Theme(theme_str))
themes = ThemeManager(app, cfg)
themes.apply(cfg.theme)
strings.load_strings(s.value("ui/locale", "en"))
win = MainWindow(themes=themes)
win.show()
sys.exit(app.exec())