Implement multiple tracks drag & drop in the document window.

This commit is contained in:
Damiano Galassi committed 2019-01-28 14:10:19 +01:00
1 parent cdddba7f3b
commit 3778909a69
3 files changed
+14 -8

No files matched your search

+4 -4
View File
@@ -387,7 +387,7 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
for item in items.reversed() {
let sourceIndex = queue.index(of: item)
queue.remove(at: IndexSet(integer: IndexSet.Element(sourceIndex)))
queue.remove(at: IndexSet(integer: sourceIndex))
if sourceIndex < currentIndex {
currentIndex -= 1
@@ -398,7 +398,7 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
source.append(currentIndex)
dest.append(sourceIndex)
table.moveRow(at: Int(sourceIndex), to: Int(currentIndex))
table.moveRow(at: sourceIndex, to: currentIndex)
}
table.endUpdates()
@@ -424,8 +424,8 @@ class QueueController : NSWindowController, NSWindowDelegate, NSPopoverDelegate,
newSource.append(destIndex)
newDest.append(sourceIndex)
if let item = queue.items(at: IndexSet(integer: IndexSet.Element(sourceIndex))).first {
queue.remove(at: IndexSet(integer: IndexSet.Element(sourceIndex)))
if let item = queue.items(at: IndexSet(integer: sourceIndex)).first {
queue.remove(at: IndexSet(integer: sourceIndex))
queue.insert(item, at: destIndex)
table.moveRow(at: sourceIndex, to: destIndex)