Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion FreeSimpleGUI/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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}"',
Expand Down