[gnome-music/wip/jfelder/sidebar-icons: 2/2] artisttile: Add an artist art




commit b0a66de93a9b4d805fcce161392c281e4be4632e
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Jan 28 21:32:42 2021 +0100

    artisttile: Add an artist art

 data/ui/ArtistTile.ui            | 28 ++++++++++++++++++++++------
 gnomemusic/widgets/artisttile.py |  5 +++++
 2 files changed, 27 insertions(+), 6 deletions(-)
---
diff --git a/data/ui/ArtistTile.ui b/data/ui/ArtistTile.ui
index c4d854a8c..97f9331f6 100644
--- a/data/ui/ArtistTile.ui
+++ b/data/ui/ArtistTile.ui
@@ -4,13 +4,29 @@
     <property name="can_focus">False</property>
     <property name="visible">True</property>
     <child>
-      <object class="GtkLabel" id="_label">
-        <property name="can_focus">False</property>
-        <property name="ellipsize">end</property>
-        <property name="halign">start</property>
-        <property name="hexpand">False</property>
-        <property name="margin">16</property>
+      <object class="GtkBox">
+        <property name="orientation">horizontal</property>
         <property name="visible">True</property>
+        <property name="margin_start">10</property>
+        <child>
+          <object class="ArtStack" id="_art_stack">
+            <property name="visible">True</property>
+            <property name="can_focus">False</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkLabel" id="_label">
+            <property name="can_focus">False</property>
+            <property name="ellipsize">end</property>
+            <property name="halign">start</property>
+            <property name="hexpand">False</property>
+            <property name="margin_start">10</property>
+            <property name="margin_end">10</property>
+            <property name="margin_top">16</property>
+            <property name="margin_bottom">16</property>
+            <property name="visible">True</property>
+          </object>
+        </child>
       </object>
     </child>
   </template>
diff --git a/gnomemusic/widgets/artisttile.py b/gnomemusic/widgets/artisttile.py
index 9be6f0fb8..cdf250b9d 100644
--- a/gnomemusic/widgets/artisttile.py
+++ b/gnomemusic/widgets/artisttile.py
@@ -25,6 +25,7 @@
 from gi.repository import GObject, Gtk
 
 from gnomemusic.coreartist import CoreArtist
+from gnomemusic.utils import ArtSize
 
 
 @Gtk.Template(resource_path='/org/gnome/Music/ui/ArtistTile.ui')
@@ -36,6 +37,7 @@ class ArtistTile(Gtk.ListBoxRow):
 
     __gtype_name__ = 'ArtistTile'
 
+    _art_stack = Gtk.Template.Child()
     _label = Gtk.Template.Child()
 
     coreartist = GObject.Property(type=CoreArtist, default=None)
@@ -46,6 +48,9 @@ class ArtistTile(Gtk.ListBoxRow):
 
         self.props.coreartist = coreartist
 
+        self._art_stack.props.size = ArtSize.SMALL
+        self._art_stack.props.coreobject = self.props.coreartist
+
         self.bind_property('text', self._label, 'label')
         self.bind_property('text', self._label, 'tooltip-text')
 


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