From 5ffdd27602e341b6d50c5b04e16876c48c770f4c Mon Sep 17 00:00:00 2001 From: wobbl Date: Sun, 29 Dec 2024 19:04:12 +0100 Subject: [PATCH] Made tracks in playlists not draggable because the playlist view isn't synced with the player's playlist. --- wobuzz/library/library.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/wobuzz/library/library.py b/wobuzz/library/library.py index d3145c4..f89e8ce 100644 --- a/wobuzz/library/library.py +++ b/wobuzz/library/library.py @@ -34,7 +34,7 @@ class Library: playlist_view = self.create_playlist_view(playlist) playlist_tabs.playlists[playlist.title] = playlist_view playlist_tabs.addTab(playlist_view, playlist.title) - playlist_view.itemDoubleClicked.connect(self.on_track_doubleclick) + playlist_view.itemActivated.connect(self.on_track_doubleclick) def create_playlist_view(self, playlist: Playlist): view = PlaylistView() @@ -51,8 +51,8 @@ class Library: track_item.setFlags( Qt.ItemFlag.ItemIsEnabled | - Qt.ItemFlag.ItemIsSelectable | - Qt.ItemFlag.ItemIsDragEnabled + Qt.ItemFlag.ItemIsSelectable # | + # Qt.ItemFlag.ItemIsDragEnabled ) track_item.track = track @@ -65,7 +65,7 @@ class Library: return view - def on_track_doubleclick(self, item, column): + def on_track_activation(self, item, column): index = item.treeWidget().indexOfTopLevelItem(item) self.app.player.play_track_in_playlist(index)