[gnome-music/wip/mschraal/core: 37/42] albumwidget2: Set state on start



commit 20bc169fca6515d94bb848a7c52f3ff9ef718d3c
Author: Marinus Schraal <mschraal gnome org>
Date:   Fri May 10 00:03:58 2019 +0200

    albumwidget2: Set state on start

 gnomemusic/widgets/albumwidget2.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/widgets/albumwidget2.py b/gnomemusic/widgets/albumwidget2.py
index 651322ab..96500a3c 100644
--- a/gnomemusic/widgets/albumwidget2.py
+++ b/gnomemusic/widgets/albumwidget2.py
@@ -142,7 +142,7 @@ class AlbumWidget2(Gtk.EventBox):
             "{} minute", "{} minutes", mins).format(mins)
 
     @log
-    def _on_row_activated(self, klass, value):
+    def _on_row_activated(self, klass, listboxrow):
         old_model = Gtk.ListStore(
             GObject.TYPE_STRING,  # title
             GObject.TYPE_STRING,
@@ -160,8 +160,9 @@ class AlbumWidget2(Gtk.EventBox):
 
         for song in self._model:
             _iter = old_model.insert_with_valuesv(-1, [5], [song.props.media])
-            if song is self._model[value.get_index()]:
+            if song is self._model[listboxrow.get_index()]:
                 activated_iter = _iter
+                listboxrow.get_child().props.state = SongWidget.State.PLAYING
 
         self._player.set_playlist(
             PlayerPlaylist.Type.ALBUM, self._album_name, old_model,


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