[gnome-music/wip/jfelder/songwidget-listboxrow: 8/10] playlistswidget: Ensure that the song rows are not selectable
- From: Jean Felder <jfelder src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-music/wip/jfelder/songwidget-listboxrow: 8/10] playlistswidget: Ensure that the song rows are not selectable
- Date: Sat, 8 May 2021 23:39:59 +0000 (UTC)
commit 746c5cb34d5931347dd4efbaa532bb026c10e3c0
Author: Jean Felder <jfelder src gnome org>
Date: Sat May 8 17:41:17 2021 +0200
playlistswidget: Ensure that the song rows are not selectable
This ensures that the play indicator stays visible when a row is
activated. The rows cannot be selected at the moment but the next
commit will introduce it.
gnomemusic/widgets/playlistswidget.py | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
---
diff --git a/gnomemusic/widgets/playlistswidget.py b/gnomemusic/widgets/playlistswidget.py
index 7f76122b6..74c8a99cf 100644
--- a/gnomemusic/widgets/playlistswidget.py
+++ b/gnomemusic/widgets/playlistswidget.py
@@ -34,6 +34,8 @@ from gnomemusic.widgets.playlistdialog import PlaylistDialog
from gnomemusic.widgets.songwidget import SongWidget
if typing.TYPE_CHECKING:
from gnomemusic.application import Application
+ from gnomemusic.coresong import CoreSong
+ from gnomemusic.grilowrappers.grltrackerplaylists import Playlist
from gnomemusic.view.playlistsview import PlaylistsView
@@ -99,7 +101,8 @@ class PlaylistsWidget(Gtk.Box):
self._remove_song_action.set_enabled(not playlist.props.is_smart)
- def _create_song_widget(self, coresong, playlist):
+ def _create_song_widget(
+ self, coresong: CoreSong, playlist: Playlist) -> Gtk.ListBoxRow:
can_dnd = not playlist.props.is_smart
song_widget = SongWidget(coresong, can_dnd, True)
song_widget.props.show_song_number = False
@@ -108,7 +111,11 @@ class PlaylistsWidget(Gtk.Box):
if can_dnd is True:
song_widget.connect("widget_moved", self._on_song_widget_moved)
- return song_widget
+ row = Gtk.ListBoxRow()
+ row.props.selectable = False
+ row.add(song_widget)
+
+ return row
def _on_song_activated(self, widget, event):
coresong = widget.props.coresong
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]