[gnome-music/wip/jfelder/remove-playlist-right-click: 2/2] discbox: Remove context menu




commit 46d7c0820ba2479324e46489d92c1d95a4b8aaae
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Feb 2 17:28:08 2022 +0100

    discbox: Remove context menu
    
    This was only added because PlaylistsWidget is also using it. It turns
    out PlaylistsWidget does not need it (see the previous commit).

 data/ui/DiscBox.ui            |  6 ------
 gnomemusic/widgets/discbox.py | 19 -------------------
 2 files changed, 25 deletions(-)
---
diff --git a/data/ui/DiscBox.ui b/data/ui/DiscBox.ui
index 57df9e70e..164d8dcbe 100644
--- a/data/ui/DiscBox.ui
+++ b/data/ui/DiscBox.ui
@@ -39,10 +39,4 @@
       </object>
     </child>
   </template>
-  <object class="GtkGestureMultiPress" id="_list_box_ctrlr">
-    <property name="widget">_list_box</property>
-    <property name="propagation-phase">capture</property>
-    <property name="button">3</property>
-    <signal name="pressed" handler="_list_box_right_click" swapped="no"/>
-  </object>
 </interface>
diff --git a/gnomemusic/widgets/discbox.py b/gnomemusic/widgets/discbox.py
index 5979eb38b..487ac52e1 100644
--- a/gnomemusic/widgets/discbox.py
+++ b/gnomemusic/widgets/discbox.py
@@ -47,7 +47,6 @@ class DiscBox(Gtk.ListBoxRow):
 
     _disc_label = Gtk.Template.Child()
     _list_box = Gtk.Template.Child()
-    _list_box_ctrlr = Gtk.Template.Child()
 
     __gsignals__ = {
         'song-activated': (GObject.SignalFlags.RUN_FIRST, None, (Gtk.Widget,))
@@ -133,21 +132,3 @@ class DiscBox(Gtk.ListBoxRow):
             song_widget.props.coresong.props.selected = not selection_state
 
         return True
-
-    @Gtk.Template.Callback()
-    def _list_box_right_click(
-            self, gesture: Gtk.GestureMultiPress, n_press: int, x: int,
-            y: int) -> None:
-        song_widget = self._list_box.get_row_at_y(y)
-
-        _, y0 = song_widget.translate_coordinates(self._list_box, 0, 0)
-        row_height = song_widget.get_allocated_height()
-        rect = Gdk.Rectangle()
-        rect.x = x
-        rect.y = y0 + 0.5 * row_height
-
-        song_context_menu = SongWidgetMenu(
-            self._application, song_widget, self._corealbum)
-        song_context_menu.props.relative_to = self._list_box
-        song_context_menu.props.pointing_to = rect
-        song_context_menu.popup()


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