[gnome-music/wip/jfelder/songwidget-menu-v3: 15/18] searchview: Add support for SongWidgetMenu




commit 1cf38958ebe812d50e04602170d17aa8141487db
Author: Jean Felder <jfelder src gnome org>
Date:   Tue Aug 3 18:05:19 2021 +0200

    searchview: Add support for SongWidgetMenu
    
    This allows to add a menu for each SongWidget of a search result.

 gnomemusic/views/searchview.py | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/gnomemusic/views/searchview.py b/gnomemusic/views/searchview.py
index f4ec3a575..85a2e6dab 100644
--- a/gnomemusic/views/searchview.py
+++ b/gnomemusic/views/searchview.py
@@ -37,6 +37,7 @@ from gnomemusic.widgets.headerbar import HeaderBar
 from gnomemusic.widgets.artistalbumswidget import ArtistAlbumsWidget
 from gnomemusic.widgets.artistsearchtile import ArtistSearchTile
 from gnomemusic.widgets.songwidget import SongWidget
+from gnomemusic.widgets.songwidgetmenu import SongWidgetMenu
 if typing.TYPE_CHECKING:
     from gnomemusic.application import Application
     from gnomemusic.coresong import CoreSong
@@ -157,6 +158,8 @@ class SearchView(Gtk.Stack):
     def _create_song_widget(self, coresong: CoreSong) -> Gtk.ListBoxRow:
         song_widget = SongWidget(coresong, False, True)
         song_widget.props.show_song_number = False
+        song_widget.props.menu = SongWidgetMenu(
+            self._application, song_widget, coresong)
 
         self.bind_property(
             "selection-mode", song_widget, "selection-mode",


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