[gnome-music/wip/jfelder/3-34-artistalbumwidget-selection-mode-allowed] artistalbumwidget: Make discboxes respect selection_mode_allowed



commit c408a46469e6bf35a6bcee24c568fe14ed865443
Author: Jean Felder <jfelder src gnome org>
Date:   Fri Jan 17 01:13:15 2020 +0100

    artistalbumwidget: Make discboxes respect selection_mode_allowed
    
    This prevents songwidgets from being wrongly selected with a Ctrl +
    left-click gesture in ArtistsView.

 gnomemusic/widgets/artistalbumwidget.py | 5 +++++
 1 file changed, 5 insertions(+)
---
diff --git a/gnomemusic/widgets/artistalbumwidget.py b/gnomemusic/widgets/artistalbumwidget.py
index 9d90fb2c..18d916e1 100644
--- a/gnomemusic/widgets/artistalbumwidget.py
+++ b/gnomemusic/widgets/artistalbumwidget.py
@@ -94,6 +94,11 @@ class ArtistAlbumWidget(Gtk.Box):
     def _create_widget(self, disc):
         disc_box = self._create_disc_box(disc.props.disc_nr, disc.model)
 
+        self._disc_list_box.bind_property(
+            "selection-mode-allowed", disc_box, "selection-mode-allowed",
+            GObject.BindingFlags.BIDIRECTIONAL
+            | GObject.BindingFlags.SYNC_CREATE)
+
         return disc_box
 
     def _create_disc_box(self, disc_nr, album_model):


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