From 29a00203ebc361b09ed38251161b80addd25cab8 Mon Sep 17 00:00:00 2001 From: PySimpleGUI Date: Sat, 30 Nov 2019 16:36:29 -0500 Subject: [PATCH] Only changes the look and feel when the user passes in a new one --- DemoPrograms/Demo_Color_Chooser_Custom.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/DemoPrograms/Demo_Color_Chooser_Custom.py b/DemoPrograms/Demo_Color_Chooser_Custom.py index d261bf40..9e2eb21c 100644 --- a/DemoPrograms/Demo_Color_Chooser_Custom.py +++ b/DemoPrograms/Demo_Color_Chooser_Custom.py @@ -659,10 +659,10 @@ def popup_color_chooser(look_and_feel=None): 'YellowGreen': '#9ACD32', } - old_look_and_feel = sg.CURRENT_LOOK_AND_FEEL - if look_and_feel is None: - look_and_feel = sg.CURRENT_LOOK_AND_FEEL - sg.change_look_and_feel(look_and_feel) + old_look_and_feel = None + if look_and_feel is not None: + old_look_and_feel = sg.CURRENT_LOOK_AND_FEEL + sg.change_look_and_feel(look_and_feel) button_size = (1, 1) @@ -696,7 +696,8 @@ def popup_color_chooser(look_and_feel=None): window['-OUT-'](f'You chose {event[0]} : {event[1]}') color_chosen = event[1] window.close() - sg.change_look_and_feel(old_look_and_feel) + if old_look_and_feel is not None: + sg.change_look_and_feel(old_look_and_feel) return color_chosen