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

Only display queue context menu on songs

This commit is contained in:
Daniel Barber 2019-06-09 18:10:48 -04:00
parent 5416d793ad
commit 8c385d9c88
Signed by: danbarber
GPG Key ID: 931D8112E0103DD8
2 changed files with 25 additions and 2 deletions

View File

@ -585,7 +585,7 @@
<rect key="frame" x="0.0" y="0.0" width="328" height="219"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="0Co-uF-CCB" id="jEJ-jg-fll">
<outlineView verticalHuggingPriority="750" allowsExpansionToolTips="YES" columnAutoresizingStyle="lastColumnOnly" selectionHighlightStyle="sourceList" multipleSelection="NO" autosaveColumns="NO" rowSizeStyle="automatic" viewBased="YES" indentationPerLevel="16" outlineTableColumn="0Co-uF-CCB" id="jEJ-jg-fll" customClass="QueueView" customModule="Persephone" customModuleProvider="target">
<rect key="frame" x="0.0" y="0.0" width="328" height="219"/>
<autoresizingMask key="autoresizingMask"/>
<size key="intercellSpacing" width="3" height="2"/>
@ -765,7 +765,7 @@
</connections>
</viewController>
<customObject id="du4-e9-TfX" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
<menu id="dYA-Jm-eOa">
<menu identifier="queueViewMenu" id="dYA-Jm-eOa">
<items>
<menuItem title="Play" id="kp1-XJ-9CL">
<modifierMask key="keyEquivalentModifierMask"/>

View File

@ -0,0 +1,23 @@
//
// QueueView.swift
// Persephone
//
// Created by Daniel Barber on 2019/6/09.
// Copyright © 2019 Dan Barber. All rights reserved.
//
import AppKit
class QueueView: NSOutlineView {
override func menu(for event: NSEvent) -> NSMenu? {
let point = convert(event.locationInWindow, from: nil)
let currentRow = row(at: point)
if currentRow > 0 {
return super.menu(for: event)
} else {
return nil
}
}
}