[gnome-music/wip/jfelder/artistview-fixes: 8/9] artistalbumwidget: Correctly set discbox properties



commit 0d82b41f49978aee84778b847aefebae8547f5e0
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Sep 10 13:58:23 2019 +0200

    artistalbumwidget: Correctly set discbox properties
    
    If the model has already been loaded (if the artist has already been
    selected from ArtistsView), _on_model_items_changed method will never
    be called. Therefore, the properties associated with each
    DiscBox (selectable and show_disc_label) will not be set correctly.
    
    Fix the issue by manually calling items_changed in the constructor.
    
    Closes: #300

 gnomemusic/widgets/artistalbumwidget.py | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index e2b9372e..ea3df015 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -89,6 +89,8 @@ class ArtistAlbumWidget(Gtk.Box):
         self._disc_list_box.bind_model(
             corealbum.props.model, self._create_widget)
 
+        corealbum.props.model.items_changed(0, 0, 0)
+
     def _create_widget(self, disc):
         disc_box = self._create_disc_box(disc.props.disc_nr, disc.model)
 


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