diff --git a/sublime/ui/main.py b/sublime/ui/main.py index 8ea676b..fbfe2e1 100644 --- a/sublime/ui/main.py +++ b/sublime/ui/main.py @@ -47,6 +47,10 @@ class MainWindow(Gtk.ApplicationWindow): 'song-clicked', lambda _, *a: self.emit('song-clicked', *a)) self.player_controls.connect( 'songs-removed', lambda _, *a: self.emit('songs-removed', *a)) + self.player_controls.connect( + 'refresh-window', + lambda _, *args: self.emit('refresh-window', *args), + ) flowbox = Gtk.Box(orientation=Gtk.Orientation.VERTICAL) flowbox.pack_start(self.stack, True, True, 0) diff --git a/sublime/ui/player_controls.py b/sublime/ui/player_controls.py index db69f07..64107a2 100644 --- a/sublime/ui/player_controls.py +++ b/sublime/ui/player_controls.py @@ -44,6 +44,11 @@ class PlayerControls(Gtk.ActionBar): GObject.TYPE_NONE, (object, ), ), + 'refresh-window': ( + GObject.SignalFlags.RUN_FIRST, + GObject.TYPE_NONE, + (object, bool), + ), } editing: bool = False current_song = None @@ -272,8 +277,9 @@ class PlayerControls(Gtk.ActionBar): selected_indexes = [clicked_row_index] def on_download_state_change(song_id=None): - # TODO should probably refresh the entire window here. - pass + # Refresh the entire window (no force) because the song could + # be in a list anywhere in the window. + self.emit('refresh-window', {}, False) song_ids = [ self.play_queue_store[idx].song_id for idx in selected_indexes