mac/menu: remove redundant quit func and use identical command func

This commit is contained in:
der richter 2024-04-01 01:10:13 +02:00
parent 3c51497954
commit 67c48ed922
1 changed files with 2 additions and 7 deletions

View File

@ -110,8 +110,8 @@ class MenuBar: NSObject {
Config(name: "Hide Others", key: "h", modifiers: [.command, .option], action: #selector(NSApp.hideOtherApplications(_:))),
Config(name: "Show All", action: #selector(NSApp.unhideAllApplications(_:))),
Config(type: .separator),
Config(name: "Quit and Remember Position", action: #selector(quit(_:)), target: self, command: "quit-watch-later"),
Config(name: "Quit mpv", key: "q", action: #selector(quit(_:)), target: self, command: "quit"),
Config(name: "Quit and Remember Position", action: #selector(command(_:)), target: self, command: "quit-watch-later"),
Config(name: "Quit mpv", key: "q", action: #selector(command(_:)), target: self, command: "quit"),
]
let fileMenuConfigs = [
@ -320,11 +320,6 @@ class MenuBar: NSObject {
}
}
@objc func quit(_ menuItem: MenuItem) {
guard let menuConfig = menuItem.config else { return }
appHub.input.command(menuConfig.command)
}
@objc func openFiles() {
let panel = NSOpenPanel()
panel.allowsMultipleSelection = true