feat: open streaming URLs without changing resolved handoffs
This commit is contained in:
@@ -94,8 +94,8 @@ extension PlayerModel {
|
||||
|
||||
private func handleKeyEvent(_ event: NSEvent, in window: NSWindow, chord: KeyChord) -> Bool {
|
||||
guard event.window === window, NSApp.modalWindow == nil, window.attachedSheet == nil else { return false }
|
||||
if chord.modifiers.contains(.command), keyBindings.shortcuts(for: .openYoutube).contains(chord) {
|
||||
return perform(.openYoutube)
|
||||
if chord.modifiers.contains(.command), keyBindings.shortcuts(for: .openStream).contains(chord) {
|
||||
return perform(.openStream)
|
||||
}
|
||||
let responder = window.firstResponder
|
||||
if let text = responder as? NSTextView, text.isEditable || text.isSelectable { return false }
|
||||
@@ -200,9 +200,9 @@ struct PlayerCommands: Commands {
|
||||
.disabled(!model.canPerform(.openFile))
|
||||
Button("Add to Queue…", action: model.addQueuePanel)
|
||||
.disabled(!model.canOpen)
|
||||
Button("Open YouTube URL…") { model.performMenuAction(.openYoutube) }
|
||||
.keyboardShortcut(model.keyBindings.shortcuts(for: .openYoutube).first?.keyboardShortcut)
|
||||
.disabled(!model.canPerform(.openYoutube))
|
||||
Button("Open Stream…") { model.performMenuAction(.openStream) }
|
||||
.keyboardShortcut(model.keyBindings.shortcuts(for: .openStream).first?.keyboardShortcut)
|
||||
.disabled(!model.canPerform(.openStream))
|
||||
Button("Close File") { model.performMenuAction(.closeFile) }
|
||||
.keyboardShortcut(model.keyBindings.shortcuts(for: .closeFile).first?.keyboardShortcut)
|
||||
.disabled(!hasFocusedScene || !model.canPerform(.closeFile))
|
||||
|
||||
Reference in New Issue
Block a user