[gnome-music/wip/jfelder/songsview-songwidget-menu: 2/2] songsview: Only create one popup for the whole list
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/songsview-songwidget-menu: 2/2] songsview: Only create one popup for the whole list
- Date: Tue, 2 Aug 2022 20:45:46 +0000 (UTC)
commit a9d34ec7773814f22d1545e21aaf4f4030b2a5d7
Author: Jean Felder <jfelder src gnome org>
Date: Wed Feb 23 20:59:29 2022 +0100
songsview: Only create one popup for the whole list
Closes: #495
gnomemusic/views/songsview.py | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/gnomemusic/views/songsview.py b/gnomemusic/views/songsview.py
index c6521660c..3de6b3d90 100644
--- a/gnomemusic/views/songsview.py
+++ b/gnomemusic/views/songsview.py
@@ -110,7 +110,12 @@ class SongsView(Gtk.Box):
list_item: Gtk.ListItem) -> None:
builder = Gtk.Builder.new_from_resource(
"/org/gnome/Music/ui/SongListItem.ui")
- list_item.props.child = builder.get_object("_song_box")
+ song_box = builder.get_object("_song_box")
+ list_item.props.child = song_box
+
+ menu_button = builder.get_object("_menu_button")
+ song_menu = SongWidgetMenu(self._application, song_box, None)
+ menu_button.props.popover = song_menu
self.bind_property(
"selection-mode", list_item, "selectable",
@@ -161,8 +166,8 @@ class SongsView(Gtk.Box):
star_hover.connect("leave", _on_star_leave)
star_image.add_controller(star_hover)
- menu_button.props.popover = SongWidgetMenu(
- self._application, list_row, coresong)
+ song_menu = menu_button.props.popover
+ song_menu.props.coreobject = coresong
b1 = coresong.bind_property(
"title", title_label, "label", GObject.BindingFlags.SYNC_CREATE)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]