[gnome-music/wip/jfelder/player-core-small-cleanups: 3/3] playertoolbar: Hide the toolbar if the playlist becomes empty



commit 67e9414a3258832c7012271caae304f68262854f
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Jul 17 23:42:00 2019 +0200

    playertoolbar: Hide the toolbar if the playlist becomes empty

 gnomemusic/widgets/playertoolbar.py | 6 ++++++
 1 file changed, 6 insertions(+)
---
diff --git a/gnomemusic/widgets/playertoolbar.py b/gnomemusic/widgets/playertoolbar.py
index d094597f..57083517 100644
--- a/gnomemusic/widgets/playertoolbar.py
+++ b/gnomemusic/widgets/playertoolbar.py
@@ -143,6 +143,12 @@ class PlayerToolbar(Gtk.ActionBar):
 
     @log
     def _sync_playing(self, player, state):
+        if (self._player.props.state == Playback.STOPPED
+                and not self._player.props.has_next
+                and not self._player.props.has_previous):
+            self.hide()
+            return
+
         self.show()
 
         if self._player.props.state == Playback.PLAYING:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]