Fusion als Standard-Thema gesetzt. Thema wird in config.json gespeichert
This commit is contained in:
@@ -74,6 +74,7 @@ class AppSettings(BaseSettings):
|
|||||||
apache_fops: list[ApacheFop] = []
|
apache_fops: list[ApacheFop] = []
|
||||||
xsl_dirs: list[XslDir] = []
|
xsl_dirs: list[XslDir] = []
|
||||||
pdf_projects: list[PdfProject] = []
|
pdf_projects: list[PdfProject] = []
|
||||||
|
theme: str | None = None
|
||||||
|
|
||||||
model_config = SettingsConfigDict(json_file=config_path)
|
model_config = SettingsConfigDict(json_file=config_path)
|
||||||
|
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ class MainWindow(QMainWindow):
|
|||||||
|
|
||||||
# Theme-Menü initialisieren
|
# Theme-Menü initialisieren
|
||||||
self._setup_theme_menu()
|
self._setup_theme_menu()
|
||||||
|
|
||||||
|
#
|
||||||
|
if (theme := app_settings.theme):
|
||||||
|
self.change_theme(theme)
|
||||||
|
else:
|
||||||
|
self.change_theme('Fusion')
|
||||||
|
|
||||||
# Bilder laden
|
# Bilder laden
|
||||||
self._load_images()
|
self._load_images()
|
||||||
@@ -109,6 +115,8 @@ class MainWindow(QMainWindow):
|
|||||||
action.setChecked(action.text() == theme_name)
|
action.setChecked(action.text() == theme_name)
|
||||||
|
|
||||||
print(f"Theme erfolgreich gewechselt zu: {theme_name}")
|
print(f"Theme erfolgreich gewechselt zu: {theme_name}")
|
||||||
|
app_settings.theme = theme_name
|
||||||
|
app_settings.save()
|
||||||
else:
|
else:
|
||||||
print(f"Fehler: Theme '{theme_name}' konnte nicht erstellt werden")
|
print(f"Fehler: Theme '{theme_name}' konnte nicht erstellt werden")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user