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




commit f073c58b2eee8528f7b9069f9461ec838455817b
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 58cd2875b..d03cd9304 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]