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




commit f79afe0a67c9b2078cf9f76c71205a1b8e29dbef
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 6dc50a325..56469ce58 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]