Skip to content

Commit

Permalink
Update music_caster.py
Browse files Browse the repository at this point in the history
refactoring + better settings behaviour
  • Loading branch information
elibroftw committed Sep 30, 2019
1 parent 096b9bd commit 7c59c22
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions music_caster.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -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,
Expand Down

0 comments on commit 7c59c22

Please sign in to comment.