[gnome-music/wip/mschraal/gtk4: 64/66] playlistview: Fix event controller



commit e9a42583cd7f3ce29cc46c5642ebe9280cff0adb
Author: Marinus Schraal <mschraal gnome org>
Date:   Thu Nov 7 00:07:20 2019 +0100

    playlistview: Fix event controller

 gnomemusic/views/playlistsview.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gnomemusic/views/playlistsview.py b/gnomemusic/views/playlistsview.py
index e845c3d7..8f8061cc 100644
--- a/gnomemusic/views/playlistsview.py
+++ b/gnomemusic/views/playlistsview.py
@@ -130,10 +130,10 @@ class PlaylistsView(BaseView):
         # self._view.props.margin_right = 80
         self._view.props.valign = Gtk.Align.START
 
-        self._controller = Gtk.GestureClick().new()
-        self._controller.props.propagation_phase = Gtk.PropagationPhase.CAPTURE
-        self._controller.props.button = Gdk.BUTTON_SECONDARY
-        self._controller.connect("pressed", self._on_view_right_clicked)
+        ctrl = Gtk.GestureClick()
+        ctrl.props.button = Gdk.BUTTON_SECONDARY
+        ctrl.connect("pressed", self._on_view_right_clicked)
+        self.add_controller(ctrl)
 
         view_container.add(self._view)
 
@@ -155,6 +155,7 @@ class PlaylistsView(BaseView):
 
     @log
     def _on_view_right_clicked(self, gesture, n_press, x, y):
+        # FIXME: Popover not working.
         requested_row = self._view.get_row_at_y(y)
         self._view.select_row(requested_row)
 


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