Invert colors of the "Refresh Button" while refresh is happening

This commit is contained in:
PySimpleGUI 2021-06-05 10:49:28 -04:00
parent 10c03cb689
commit f239ab36ba
1 changed files with 4 additions and 0 deletions

View File

@ -163,7 +163,11 @@ def main():
if choose_theme(loc) is not None:
_, window = window.close(), make_window(loc)
elif event in ('Refresh', sg.TIMEOUT_KEY):
# Invert colors of simulated "button" (Text Element) while the refresh is happening
window['Refresh'].update(text_color=sg.theme_text_element_background_color(), background_color=sg.theme_text_color())
window.refresh()
refresh(window)
window['Refresh'].update(text_color=sg.theme_text_color(), background_color=sg.theme_text_element_background_color())
elif event in [str(x) for x in range(1,11)]:
window.set_alpha(int(event)/10)
sg.user_settings_set_entry('-alpha-', int(event)/10)