1
1
mirror of https://github.com/danbee/persephone synced 2025-03-04 08:39:11 +00:00

Double clicking the header no longer plays a track

This commit is contained in:
Daniel Barber 2019-02-13 21:39:24 -05:00
parent e6e020d23c
commit 3e735893a2
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8

View File

@ -58,7 +58,9 @@ class QueueViewController: NSViewController, NSOutlineViewDataSource, NSOutlineV
let queuePos = view.selectedRow - 1
AppDelegate.mpdClient.playTrack(queuePos: queuePos)
if queuePos >= 0 {
AppDelegate.mpdClient.playTrack(queuePos: queuePos)
}
}
@objc func stateChanged(_ notification: Notification) {
@ -187,8 +189,15 @@ class QueueViewController: NSViewController, NSOutlineViewDataSource, NSOutlineV
}
}
func outlineView(_ outlineView: NSOutlineView, shouldSelectItem item: Any) -> Bool {
return item is SongItem
func outlineView(
_ outlineView: NSOutlineView,
selectionIndexesForProposedSelection proposedSelectionIndexes: IndexSet
) -> IndexSet {
if proposedSelectionIndexes.contains(0) {
return IndexSet.init()
} else {
return proposedSelectionIndexes
}
}
@IBOutlet var queueView: NSOutlineView!