Merge pull request #2285 from PySimpleGUI/Dev-latest

Only changes the look and feel when the user passes in a new one
This commit is contained in:
PySimpleGUI 2019-11-30 16:36:49 -05:00 committed by GitHub
commit fca7b87da9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 5 deletions

View File

@ -659,10 +659,10 @@ def popup_color_chooser(look_and_feel=None):
'YellowGreen': '#9ACD32', 'YellowGreen': '#9ACD32',
} }
old_look_and_feel = sg.CURRENT_LOOK_AND_FEEL old_look_and_feel = None
if look_and_feel is None: if look_and_feel is not None:
look_and_feel = sg.CURRENT_LOOK_AND_FEEL old_look_and_feel = sg.CURRENT_LOOK_AND_FEEL
sg.change_look_and_feel(look_and_feel) sg.change_look_and_feel(look_and_feel)
button_size = (1, 1) 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]}') window['-OUT-'](f'You chose {event[0]} : {event[1]}')
color_chosen = event[1] color_chosen = event[1]
window.close() 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 return color_chosen