[gnome-music/wip/jfelder/new-artist-design: 22/26] albumwidget: Add a show_artist_label property




commit 3e2f2221821084f63ce88015bc9e75bb855ff180
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Jul 30 18:04:24 2021 +0200

    albumwidget: Add a show_artist_label property
    
    It makes it possible to hide the artist label.
    This will be used by ArtistAlbumsWidget in a future commit.

 gnomemusic/widgets/albumwidget.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gnomemusic/widgets/albumwidget.py b/gnomemusic/widgets/albumwidget.py
index 49d78e862..d1f6056ae 100644
--- a/gnomemusic/widgets/albumwidget.py
+++ b/gnomemusic/widgets/albumwidget.py
@@ -61,6 +61,7 @@ class AlbumWidget(Gtk.Box):
     _title_label = Gtk.Template.Child()
 
     selection_mode = GObject.Property(type=bool, default=False)
+    show_artist_label = GObject.Property(type=bool, default=True)
 
     def __init__(self, application: Application) -> None:
         """Initialize the AlbumWidget.
@@ -84,6 +85,10 @@ class AlbumWidget(Gtk.Box):
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
 
+        self.bind_property(
+            "show-artist-label", self._artist_label, "visible",
+            GObject.BindingFlags.SYNC_CREATE)
+
         self.connect("notify::selection-mode", self._on_selection_mode_changed)
 
         action_group = Gio.SimpleActionGroup()


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