[gnome-music/wip/jfelder/searchview-new-style: 8/15] searchview: Port artists list to a flowbox



commit eedca79948258dbd97ec6769cd2c9f6260fc1a68
Author: Jean Felder <jfelder src gnome org>
Date:   Sat Aug 3 17:20:41 2019 +0200

    searchview: Port artists list to a flowbox

 data/ui/SearchView.ui          | 15 ++++++++++++++-
 gnomemusic/views/searchview.py |  6 +++---
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/data/ui/SearchView.ui b/data/ui/SearchView.ui
index 7ad028cf..0329bdf8 100644
--- a/data/ui/SearchView.ui
+++ b/data/ui/SearchView.ui
@@ -46,8 +46,21 @@
               </object>
             </child>
             <child>
-              <object class="GtkFlowBox" id="_artist_listbox">
+              <object class="GtkFlowBox" id="_artist_flowbox">
+                <property name="column_spacing">6</property>
+                <property name="halign">fill</property>
+                <property name="hexpand">True</property>
+                <property name="homogeneous">True</property>
+                <property name="margin">18</property>
+                <property name="max-children-per-line">6</property>
+                <property name="min-children-per-line">1</property>
+                <property name="row_spacing">12</property>
+                <property name="selection-mode">none</property>
+                <property name="valign">start</property>
                 <property name="visible">True</property>
+                <style>
+                  <class name="content-view"/>
+                </style>
               </object>
             </child>
             <child>
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index fa9f26f8..14cd9943 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -50,7 +50,7 @@ class SearchView(Gtk.Stack):
     selection_mode = GObject.Property(type=bool, default=False)
 
     _album_flowbox = Gtk.Template.Child()
-    _artist_listbox = Gtk.Template.Child()
+    _artist_flowbox = Gtk.Template.Child()
     _search_results = Gtk.Template.Child()
     _songs_listbox = Gtk.Template.Child()
 
@@ -89,7 +89,7 @@ class SearchView(Gtk.Stack):
         self._album_flowbox.connect(
             "child-activated", self._on_album_activated)
 
-        self._artist_listbox.bind_model(
+        self._artist_flowbox.bind_model(
             self._artist_filter, self._create_artist_widget)
 
         self._player = self._application.props.player
@@ -257,7 +257,7 @@ class SearchView(Gtk.Stack):
 
             self._songs_listbox.foreach(song_select)
             self._album_flowbox.foreach(album_select)
-            self._artist_listbox.foreach(artist_select)
+            self._artist_flowbox.foreach(artist_select)
 
     def select_all(self):
         self._select_all(True)


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