[gnome-music/wip/mschraal/gtk4: 135/143] songsview: Fix event controller



commit 8ae2105d00334d6677af8015b665005001e53408
Author: Marinus Schraal <mschraal gnome org>
Date:   Wed Nov 6 23:38:42 2019 +0100

    songsview: Fix event controller

 gnomemusic/views/songsview.py | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index 372f9228..95265c6b 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -81,9 +81,10 @@ class SongsView(BaseView):
         self._view.props.model = self._coremodel.props.songs_gtkliststore
         self._view.props.activate_on_single_click = True
 
-        self._ctrl = Gtk.GestureClick().new()
-        self._ctrl.props.propagation_phase = Gtk.PropagationPhase.CAPTURE
-        self._ctrl.connect("released", self._on_view_clicked)
+        ctrl = Gtk.GestureClick().new()
+        ctrl.connect("released", self._on_view_clicked)
+        ctrl.props.propagation_phase = Gtk.PropagationPhase.CAPTURE
+        self.add_controller(ctrl)
 
         self._view.get_selection().props.mode = Gtk.SelectionMode.SINGLE
         self._view.connect('row-activated', self._on_item_activated)


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