From 923b773ee495fa42441a5a3878277fba53dd775f Mon Sep 17 00:00:00 2001 From: lm Date: Fri, 17 Oct 2025 13:04:51 +0200 Subject: [PATCH] Fallback to classic ttk when ttkbootstrap fails --- app/gui/theme.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/app/gui/theme.py b/app/gui/theme.py index 785bd38..82e4edf 100644 --- a/app/gui/theme.py +++ b/app/gui/theme.py @@ -31,12 +31,16 @@ class ThemeMixin: """Initialise ttk style handling and apply the detected theme.""" if HAS_TTKBOOTSTRAP: try: - # Ensure msgcat package is available before ttkbootstrap initialises translations - self.root.tk.call("package", "require", "msgcat") # type: ignore[attr-defined] + try: + self.root.tk.call("package", "require", "msgcat") # type: ignore[attr-defined] + except Exception: + pass + self.style = tb.Style() + self.using_tb = True except Exception: - pass - self.style = tb.Style() - self.using_tb = True + self.style = ttk.Style() + self.style.theme_use("clam") + self.using_tb = False else: self.style = ttk.Style() self.style.theme_use("clam")