From 686bac7499e9ea237a5db57cc4cade984be490f9 Mon Sep 17 00:00:00 2001 From: "dries.k" Date: Wed, 2 Nov 2022 23:42:29 +0100 Subject: [PATCH] format theme string --- gotify_tray/gui/themes/__init__.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gotify_tray/gui/themes/__init__.py b/gotify_tray/gui/themes/__init__.py index 48d3a63..36463af 100644 --- a/gotify_tray/gui/themes/__init__.py +++ b/gotify_tray/gui/themes/__init__.py @@ -11,8 +11,8 @@ logger = logging.getLogger("gotify-tray") styles = { "default": default, - "dark_purple": dark_purple, - "light_purple": light_purple, + "dark purple": dark_purple, + "light purple": light_purple, } @@ -24,7 +24,7 @@ def set_theme(app: QtWidgets.QApplication, style: str = "default"): return stylesheet = "" - with open(get_abs_path(f"gotify_tray/gui/themes/{style}/style.qss"), "r") as f: + with open(get_abs_path(f"gotify_tray/gui/themes/{style.replace(' ', '_')}/style.qss"), "r") as f: stylesheet += f.read() app.setPalette(styles[style].get_palette()) @@ -35,4 +35,4 @@ def get_themes(): def get_theme_file(file: str, theme: str = None) -> str: theme = settings.value("theme", type=str) if not theme else theme - return get_abs_path(f"gotify_tray/gui/themes/{theme}/{file}") + return get_abs_path(f"gotify_tray/gui/themes/{theme.replace(' ', '_')}/{file}")