[gnome-music/wip/mschraal/core: 50/164] discllistbox: Replace flowbox with listbox for ease of development



commit 869e6edce3aa12e780cd9a3106d5df0a3e99fa1b
Author: Marinus Schraal <mschraal gnome org>
Date:   Sat Jun 1 14:19:28 2019 +0200

    discllistbox: Replace flowbox with listbox for ease of development

 data/ui/DiscBox.ui                      |  6 +++---
 gnomemusic/widgets/disclistboxwidget.py | 15 +++++++++------
 2 files changed, 12 insertions(+), 9 deletions(-)
---
diff --git a/data/ui/DiscBox.ui b/data/ui/DiscBox.ui
index 923f46e3..8bc0bede 100644
--- a/data/ui/DiscBox.ui
+++ b/data/ui/DiscBox.ui
@@ -24,12 +24,12 @@
         </packing>
       </child>
       <child>
-        <object class="DiscSongsFlowBox" id="_disc_songs_flowbox">
+        <object class="GtkListBox" id="_list_box">
           <property name="visible">True</property>
           <property name="can_focus">False</property>
           <property name="valign">start</property>
-          <property name="orientation">vertical</property>
-          <property name="homogeneous">True</property>
+<!--      <property name="orientation">vertical</property> -->
+<!--           <property name="homogeneous">True</property> -->
           <property name="selection_mode">none</property>
         </object>
         <packing>
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index bc40c68d..f5f2598c 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -30,7 +30,7 @@ from gnomemusic.widgets.songwidget import SongWidget
 import gnomemusic.utils as utils
 
 
-class DiscSongsFlowBox(Gtk.FlowBox):
+class DiscSongsFlowBox(Gtk.ListBox):
     """FlowBox containing the songs on one disc
 
     DiscSongsFlowBox allows setting the number of columns to
@@ -92,7 +92,8 @@ class DiscBox(Gtk.Box):
     __gtype_name__ = 'DiscBox'
 
     _disc_label = Gtk.Template.Child()
-    _disc_songs_flowbox = Gtk.Template.Child()
+    #_disc_songs_flowbox = Gtk.Template.Child()
+    _list_box = Gtk.Template.Child()
 
     __gsignals__ = {
         'selection-changed': (GObject.SignalFlags.RUN_FIRST, None, ()),
@@ -124,12 +125,12 @@ class DiscBox(Gtk.Box):
 
         if listmodel is not None:
             self._listmodel = listmodel
-            self._disc_songs_flowbox.bind_model(
+            self._list_box.bind_model(
                 self._listmodel, self._create_widget)
 
-        self.bind_property(
-            'columns', self._disc_songs_flowbox, 'columns',
-            GObject.BindingFlags.SYNC_CREATE)
+        # self.bind_property(
+        #     'columns', self._list_box, 'columns',
+        #     GObject.BindingFlags.SYNC_CREATE)
         self.bind_property(
             'show-disc-label', self._disc_label, 'visible',
             GObject.BindingFlags.SYNC_CREATE)
@@ -212,6 +213,8 @@ class DiscBox(Gtk.Box):
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
 
+        song_widget.show_all()
+
         return song_widget
 
     @log


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