[gnome-music/wip/mschraal/core: 82/190] albumwidget: re-activate selection mode



commit dbf8ecb31942a232175283565af1a0f80de7af92
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Jun 20 22:07:51 2019 +0200

    albumwidget: re-activate selection mode

 gnomemusic/widgets/albumwidget2.py      |  5 +++++
 gnomemusic/widgets/disclistboxwidget.py | 11 +++++++++++
 2 files changed, 16 insertions(+)
---
diff --git a/gnomemusic/widgets/albumwidget2.py b/gnomemusic/widgets/albumwidget2.py
index f6e6fd5a..10e4f4cc 100644
--- a/gnomemusic/widgets/albumwidget2.py
+++ b/gnomemusic/widgets/albumwidget2.py
@@ -93,6 +93,11 @@ class AlbumWidget2(Gtk.EventBox):
         disc_box = self._create_disc_box(
             disc.media.get_album_disc_number(), disc.model)
 
+        self.bind_property(
+            "selection-mode", disc_box, "selection-mode",
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
+
         return disc_box
 
     def _create_disc_box(self, disc_nr, album_model):
diff --git a/gnomemusic/widgets/disclistboxwidget.py b/gnomemusic/widgets/disclistboxwidget.py
index 4c197920..d711615b 100644
--- a/gnomemusic/widgets/disclistboxwidget.py
+++ b/gnomemusic/widgets/disclistboxwidget.py
@@ -167,6 +167,11 @@ class DiscBox(Gtk.Box):
             GObject.BindingFlags.BIDIRECTIONAL
             | GObject.BindingFlags.SYNC_CREATE)
 
+        self.bind_property(
+            "selection-mode", song_widget, "selection-mode",
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
+
         song_widget.connect('button-release-event', self._song_activated)
 
         song_widget.show_all()
@@ -278,3 +283,9 @@ class DiscListBox(Gtk.ListBox):
             return
 
         self._selection_mode = value
+
+        def set_selection_mode(child):
+            print("set selection mode on", child)
+            child.props.selection_mode = value
+
+        self.foreach(set_selection_mode)


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