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




commit 50cc9bbac77f33559bc67fc1e03dc6ef40218a80
Author: Jean Felder <jfelder src gnome org>
Date:   Wed Feb 2 18:22:27 2022 +0100

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

 data/ui/SearchView.ui          |  6 ------
 gnomemusic/views/searchview.py | 19 -------------------
 2 files changed, 25 deletions(-)
---
diff --git a/data/ui/SearchView.ui b/data/ui/SearchView.ui
index a6e41ee37..d7dc09dd1 100644
--- a/data/ui/SearchView.ui
+++ b/data/ui/SearchView.ui
@@ -242,10 +242,4 @@
       </object>
     </child>
   </template>
-  <object class="GtkGestureMultiPress" id="_songs_listbox_ctrlr">
-    <property name="widget">_songs_listbox</property>
-    <property name="propagation-phase">capture</property>
-    <property name="button">3</property>
-    <signal name="pressed" handler="_songs_listbox_right_click" swapped="no"/>
-  </object>
 </interface>
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index a1e6d8201..e9d2cca23 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -79,7 +79,6 @@ class SearchView(Gtk.Stack):
     _search_results = Gtk.Template.Child()
     _songs_header = Gtk.Template.Child()
     _songs_listbox = Gtk.Template.Child()
-    _songs_listbox_ctrlr = Gtk.Template.Child()
     _view_all_albums = Gtk.Template.Child()
     _view_all_artists = Gtk.Template.Child()
 
@@ -278,24 +277,6 @@ class SearchView(Gtk.Stack):
 
         return True
 
-    @Gtk.Template.Callback()
-    def _songs_listbox_right_click(
-            self, gesture: Gtk.GestureMultiPress, n_press: int, x: int,
-            y: int) -> None:
-        song_widget = self._songs_listbox.get_row_at_y(y)
-
-        _, y0 = song_widget.translate_coordinates(self._songs_listbox, 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, song_widget.props.coresong)
-        song_context_menu.props.relative_to = self._songs_listbox
-        song_context_menu.props.pointing_to = rect
-        song_context_menu.popup()
-
     def _on_album_flowbox_size_allocate(self, widget, allocation, data=None):
         nb_children = self._album_filter.get_n_items()
         if nb_children == 0:


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