31 lines
918 B
Python
31 lines
918 B
Python
"""Erzeugt das native Windows-Programmsymbol aus dem Qt-Vektordrawing."""
|
|
|
|
from __future__ import annotations
|
|
|
|
import os
|
|
import sys
|
|
from pathlib import Path
|
|
|
|
PROJECT_ROOT = Path(__file__).resolve().parents[1]
|
|
sys.path.insert(0, str(PROJECT_ROOT / "src"))
|
|
os.environ.setdefault("QT_QPA_PLATFORM", "offscreen")
|
|
|
|
from PyQt6.QtWidgets import QApplication # noqa: E402
|
|
|
|
from syncvito.icons import app_icon # noqa: E402
|
|
|
|
|
|
def main() -> None:
|
|
"""Schreibt eine hochauflösende ICO-Datei in den Assets-Ordner."""
|
|
application = QApplication.instance() or QApplication([])
|
|
output = PROJECT_ROOT / "assets" / "SyncVito.ico"
|
|
output.parent.mkdir(parents=True, exist_ok=True)
|
|
pixmap = app_icon(256).pixmap(256, 256)
|
|
if not pixmap.save(str(output), "ICO"):
|
|
raise RuntimeError(f"Programmsymbol konnte nicht geschrieben werden: {output}")
|
|
application.quit()
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|