From 7c59c223bf4ea1b3a1d576d725b94f48c8c66500 Mon Sep 17 00:00:00 2001 From: Elijah Lopez Date: Sun, 29 Sep 2019 20:02:44 -0400 Subject: [PATCH] Update music_caster.py refactoring + better settings behaviour --- music_caster.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/music_caster.py b/music_caster.py index 48fc848e..850a22f7 100644 --- a/music_caster.py +++ b/music_caster.py @@ -454,7 +454,10 @@ def on_press(key): if playing_status in {'PAUSED', 'PLAYING'}: autoplay = False if playing_status == 'PAUSED' else True play_file(music_queue[0], position=current_pos, autoplay=autoplay, switching_device=True) - elif menu_item == 'Settings' and not settings_active: + elif menu_item == 'Settings': + if settings_active: + settings_window.TKroot.focus_force() + continue settings_active = True # RELIEFS: RELIEF_RAISED RELIEF_SUNKEN RELIEF_FLAT RELIEF_RIDGE RELIEF_GROOVE RELIEF_SOLID settings_layout = [ @@ -480,7 +483,7 @@ def on_press(key): [Sg.Button(button_text='Remove Selected Folder', button_color=button_color, key='Remove Folder', enable_events=True, font=font_normal)], [Sg.FolderBrowse('Add Folder', button_color=button_color, font=font_normal, enable_events=True)], - [Sg.Button('Open Settings File', key='Open Settings', button_color=button_color, font=font_normal, + [Sg.Button('Open settings.json', key='Open Settings', button_color=button_color, font=font_normal, enable_events=True)]], background_color=bg, border_width=0)] ] settings_window = Sg.Window('Music Caster Settings', settings_layout, background_color=bg, icon=WINDOW_ICON,