From 9a6f0eccb2869267ed078159a74a483e0f96a8df Mon Sep 17 00:00:00 2001 From: Orsiris de Jong Date: Sun, 25 Jan 2026 19:34:02 +0100 Subject: [PATCH 1/3] Add external TTK themes --- FreeSimpleGUI/__init__.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/FreeSimpleGUI/__init__.py b/FreeSimpleGUI/__init__.py index 5925f37c..6656bcd2 100644 --- a/FreeSimpleGUI/__init__.py +++ b/FreeSimpleGUI/__init__.py @@ -190,7 +190,7 @@ DEFAULT_TTK_THEME = THEME_DEFAULT ttk_theme_in_use = None # TTK_THEME_LIST = ('default', 'winnative', 'clam', 'alt', 'classic', 'vista', 'xpnative') - +ADDITIONAL_TTK_STYLING_PATHS = None USE_TTK_BUTTONS = None @@ -4430,6 +4430,12 @@ def _add_right_click_menu(element, toplevel_form): def _change_ttk_theme(style, theme_name): global ttk_theme_in_use + + if ADDITIONAL_TTK_STYLING_PATHS: + if not hasattr(style.master, "_additional_styling_loaded"): + style.tk.call("source", str(ADDITIONAL_TTK_STYLING_PATHS)) + style.master._additional_styling_loaded = True # type: ignore + if theme_name not in style.theme_names(): _error_popup_with_traceback( f'You are trying to use TTK theme "{theme_name}"', From e9663d09605ade6b7891cec38814f43d5b85df44 Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 25 Jan 2026 20:58:05 +0100 Subject: [PATCH 2/3] Make linter happy: Fix double quoted string --- FreeSimpleGUI/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeSimpleGUI/__init__.py b/FreeSimpleGUI/__init__.py index 6656bcd2..a671b39b 100644 --- a/FreeSimpleGUI/__init__.py +++ b/FreeSimpleGUI/__init__.py @@ -4432,7 +4432,7 @@ def _change_ttk_theme(style, theme_name): global ttk_theme_in_use if ADDITIONAL_TTK_STYLING_PATHS: - if not hasattr(style.master, "_additional_styling_loaded"): + if not hasattr(style.master, '_additional_styling_loaded'): style.tk.call("source", str(ADDITIONAL_TTK_STYLING_PATHS)) style.master._additional_styling_loaded = True # type: ignore From 9ddc717a19b1ae8a91416b3b1f3b90283f6961eb Mon Sep 17 00:00:00 2001 From: deajan Date: Sun, 25 Jan 2026 21:05:56 +0100 Subject: [PATCH 3/3] Make linter happy: Fix double quoted strings again --- FreeSimpleGUI/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/FreeSimpleGUI/__init__.py b/FreeSimpleGUI/__init__.py index a671b39b..51823baa 100644 --- a/FreeSimpleGUI/__init__.py +++ b/FreeSimpleGUI/__init__.py @@ -4433,7 +4433,7 @@ def _change_ttk_theme(style, theme_name): if ADDITIONAL_TTK_STYLING_PATHS: if not hasattr(style.master, '_additional_styling_loaded'): - style.tk.call("source", str(ADDITIONAL_TTK_STYLING_PATHS)) + style.tk.call('source', str(ADDITIONAL_TTK_STYLING_PATHS)) style.master._additional_styling_loaded = True # type: ignore if theme_name not in style.theme_names():