Fix window close behavior (fixes #48)
This commit is contained in:
parent
bfb4f80b8c
commit
12b920b0af
|
@ -29,6 +29,7 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
window.makeKeyAndOrderFront(nil)
|
||||
window.titleVisibility = .hidden
|
||||
window.toolbar = toolbar
|
||||
window.isReleasedWhenClosed = false
|
||||
if storeList.modifiableStore?.isAvailable ?? false {
|
||||
let plus = NSTitlebarAccessoryViewController()
|
||||
plus.view = NSButton(image: NSImage(named: NSImage.addTemplateName)!, target: self, action: #selector(add(sender:)))
|
||||
|
@ -42,6 +43,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||
agentStatusChecker.check()
|
||||
}
|
||||
|
||||
func applicationShouldHandleReopen(_ sender: NSApplication, hasVisibleWindows flag: Bool) -> Bool {
|
||||
guard !flag else { return false }
|
||||
window.makeKeyAndOrderFront(self)
|
||||
return true
|
||||
}
|
||||
|
||||
@IBAction func add(sender: AnyObject?) {
|
||||
var addWindow: NSWindow!
|
||||
let addView = CreateSecretView(store: storeList.modifiableStore!) {
|
||||
|
|
Loading…
Reference in New Issue