Add New Window to Dock menu (#2340)
* Add Dock menu new-window regression test * Add New Window to Dock menu
This commit is contained in:
parent
27db2eb8dd
commit
29c0f525db
2 changed files with 50 additions and 0 deletions
|
|
@ -5511,6 +5511,18 @@ final class AppDelegate: NSObject, NSApplicationDelegate, UNUserNotificationCent
|
|||
mainWindowContexts.values.first(where: { $0.windowId == windowId })?.sidebarState.isVisible
|
||||
}
|
||||
|
||||
func applicationDockMenu(_ sender: NSApplication) -> NSMenu? {
|
||||
let menu = NSMenu(title: "")
|
||||
let newWindowItem = NSMenuItem(
|
||||
title: String(localized: "menu.file.newWindow", defaultValue: "New Window"),
|
||||
action: #selector(openNewMainWindow(_:)),
|
||||
keyEquivalent: ""
|
||||
)
|
||||
newWindowItem.target = self
|
||||
menu.addItem(newWindowItem)
|
||||
return menu
|
||||
}
|
||||
|
||||
@objc func openNewMainWindow(_ sender: Any?) {
|
||||
_ = createMainWindow()
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue