[gnome-music/wip/jfelder/gtk4-v3: 132/174] discbox: Remove useless button check on row activation




commit dcd6b1cdb0dae27a65ec07735265fb0f48bcc93c
Author: Jean Felder <jfelder src gnome org>
Date:   Thu Feb 3 19:18:50 2022 +0100

    discbox: Remove useless button check on row activation
    
    The activate signal can only be triggered with the primary button.

 gnomemusic/widgets/discbox.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)
---
diff --git a/gnomemusic/widgets/discbox.py b/gnomemusic/widgets/discbox.py
index 487ac52e1..e38bd39c2 100644
--- a/gnomemusic/widgets/discbox.py
+++ b/gnomemusic/widgets/discbox.py
@@ -121,14 +121,11 @@ class DiscBox(Gtk.ListBoxRow):
             song_widget.props.coresong.props.selected = True
             return True
 
-        (_, button) = event.get_button()
-        if (button == Gdk.BUTTON_PRIMARY
-                and not self.props.selection_mode):
-            self.emit("song-activated", song_widget)
-
         if self.props.selection_mode:
             song_widget.props.select_click = True
             selection_state = song_widget.props.coresong.props.selected
             song_widget.props.coresong.props.selected = not selection_state
+        else:
+            self.emit("song-activated", song_widget)
 
         return True


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