This commit is contained in:
Benjamin Schaaf
2022-01-09 17:51:19 +11:00
parent 6c2dbf192e
commit 6a68cd1c99
3 changed files with 27 additions and 16 deletions

View File

@@ -733,6 +733,7 @@ class SublimeMusicApp(Gtk.Application):
@dbus_propagate()
def shuffle(self):
if self.app_config.state.current_song:
if self.app_config.state.shuffle_on:
# Revert to the old play queue.
old_play_queue_copy = self.app_config.state.old_play_queue

View File

@@ -94,6 +94,8 @@ class Desktop(Gtk.Box):
self.device_button.set_icon(f"chromecast{icon}-symbolic")
self.play_queue_button.set_sensitive(len(app_config.state.play_queue) > 0)
# Volume button and slider
if app_config.state.is_muted:
icon_name = "muted"

View File

@@ -119,6 +119,14 @@ class MobileHandle(Gtk.ActionBar):
return box
def update(self, app_config: AppConfiguration, force: bool = False):
empty_queue = len(app_config.state.play_queue) == 0
self.play_queue_button.set_sensitive(not empty_queue)
self.menu_button.set_sensitive(not empty_queue)
if empty_queue:
self.state.play_queue_open = False
if app_config.state.current_song is not None:
self.song_title.set_markup(bleach.clean(app_config.state.current_song.title))
# TODO (#71): use walrus once MYPY gets its act together