mirror of
https://github.com/maxgoedjen/secretive.git
synced 2024-11-22 05:27:28 +00:00
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.makeKeyAndOrderFront(nil)
|
||||||
window.titleVisibility = .hidden
|
window.titleVisibility = .hidden
|
||||||
window.toolbar = toolbar
|
window.toolbar = toolbar
|
||||||
|
window.isReleasedWhenClosed = false
|
||||||
if storeList.modifiableStore?.isAvailable ?? false {
|
if storeList.modifiableStore?.isAvailable ?? false {
|
||||||
let plus = NSTitlebarAccessoryViewController()
|
let plus = NSTitlebarAccessoryViewController()
|
||||||
plus.view = NSButton(image: NSImage(named: NSImage.addTemplateName)!, target: self, action: #selector(add(sender:)))
|
plus.view = NSButton(image: NSImage(named: NSImage.addTemplateName)!, target: self, action: #selector(add(sender:)))
|
||||||
@ -42,6 +43,12 @@ class AppDelegate: NSObject, NSApplicationDelegate {
|
|||||||
agentStatusChecker.check()
|
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?) {
|
@IBAction func add(sender: AnyObject?) {
|
||||||
var addWindow: NSWindow!
|
var addWindow: NSWindow!
|
||||||
let addView = CreateSecretView(store: storeList.modifiableStore!) {
|
let addView = CreateSecretView(store: storeList.modifiableStore!) {
|
||||||
|
Loading…
Reference in New Issue
Block a user