[gnome-music/wip/mschraal/artistalbums-cleanup: 2/3] searchview: Bind child selection-mode



commit 46b293fbdded4138b033571ec75f6b9b1c4b64d1
Author: Marinus Schraal <mschraal gnome org>
Date:   Tue Sep 4 13:34:55 2018 +0200

    searchview: Bind child selection-mode
    
    ArtistAlbumsWidget still used the selection-mode property from HeaderBar to
    bind it's own state.
    Use the parent state by SearchView instead.

 gnomemusic/views/searchview.py           | 3 +++
 gnomemusic/widgets/artistalbumswidget.py | 5 -----
 2 files changed, 3 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index 6b8d6d42..970a6bcd 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -153,6 +153,9 @@ class SearchView(BaseView):
 
             self._artist_albums_widget.bind_property(
                 'selected-items-count', self, 'selected-items-count')
+            self.bind_property(
+                'selection-mode', self._artist_albums_widget, 'selection-mode',
+                GObject.BindingFlags.BIDIRECTIONAL)
 
             self._headerbar.props.state = HeaderBar.State.SEARCH
             self._headerbar.props.title = artist
diff --git a/gnomemusic/widgets/artistalbumswidget.py b/gnomemusic/widgets/artistalbumswidget.py
index 4c0ced82..2eb88152 100644
--- a/gnomemusic/widgets/artistalbumswidget.py
+++ b/gnomemusic/widgets/artistalbumswidget.py
@@ -89,11 +89,6 @@ class ArtistAlbumsWidget(Gtk.Box):
         self._songs_grid_size_group = Gtk.SizeGroup.new(
             Gtk.SizeGroupMode.HORIZONTAL)
 
-        self.bind_property(
-            'selection-mode', self._headerbar, 'selection-mode',
-            GObject.BindingFlags.BIDIRECTIONAL |
-            GObject.BindingFlags.SYNC_CREATE)
-
         self._window.notifications_popup.push_loading()
 
         self._albums_to_load = len(albums)


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