[gnome-music/wip/jfelder/gtk4-v3: 150/259] lastfmdialog: Fix configure click controller




commit 356476dcc5fb35f43fb9e84ec7950dec61466120
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Feb 3 21:18:02 2022 +0100

    lastfmdialog: Fix configure click controller

 data/ui/LastfmDialog.ui            | 6 +-----
 gnomemusic/widgets/lastfmdialog.py | 5 +++--
 2 files changed, 4 insertions(+), 7 deletions(-)
---
diff --git a/data/ui/LastfmDialog.ui b/data/ui/LastfmDialog.ui
index f4d225c77..926c78724 100644
--- a/data/ui/LastfmDialog.ui
+++ b/data/ui/LastfmDialog.ui
@@ -50,11 +50,7 @@
         </child>
         <child>
           <object class="GtkButton" id="_action_button">
-            <child>
-              <object class="GtkGestureClick">
-                <signal name="released" handler="_on_action_button_clicked" swapped="no"/>
-              </object>
-            </child>
+            <signal name="clicked" handler="_on_action_button_clicked" swapped="no"/>
             <property name="halign">start</property>
             <property name="label" translatable="yes">Login</property>
             <property name="margin-bottom">8</property>
diff --git a/gnomemusic/widgets/lastfmdialog.py b/gnomemusic/widgets/lastfmdialog.py
index 1cf32cf11..00d39ed6c 100644
--- a/gnomemusic/widgets/lastfmdialog.py
+++ b/gnomemusic/widgets/lastfmdialog.py
@@ -24,7 +24,7 @@
 
 from gettext import gettext as _
 
-from gi.repository import Gtk
+from gi.repository import Gdk, Gtk
 
 from gnomemusic.scrobbler import GoaLastFM
 
@@ -72,5 +72,6 @@ class LastfmDialog(Gtk.Dialog):
         self._action_label.props.label = action
 
     @Gtk.Template.Callback()
-    def _on_action_button_clicked(self, widget, n_press, x, y):
+    def _on_action_button_clicked(self, btn: Gtk.Button) -> bool:
         self._lastfm_scrobbler.configure()
+        return Gdk.EVENT_STOP


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