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



commit 8185cb31361ac472949fcc87ab133b615d5ef6a4
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]