improves plak
This commit is contained in:
@@ -43,10 +43,12 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
}
|
||||
|
||||
func applicationWillResignActive(_ notification: Notification) {
|
||||
windowController?.page.closeEditor()
|
||||
store?.flush()
|
||||
}
|
||||
|
||||
func applicationWillTerminate(_ notification: Notification) {
|
||||
windowController?.page.closeEditor()
|
||||
store?.flush()
|
||||
}
|
||||
|
||||
@@ -64,6 +66,7 @@ final class AppDelegate: NSObject, NSApplicationDelegate {
|
||||
|
||||
/// Only hiding the app gives focus back to the previous app; an ordered-out window leaves Plak active.
|
||||
private func hidePlak() {
|
||||
windowController?.page.closeEditor()
|
||||
NSApp.hide(nil)
|
||||
}
|
||||
|
||||
|
||||
@@ -42,13 +42,15 @@ enum MainMenu {
|
||||
|
||||
private static func editMenu() -> NSMenu {
|
||||
let menu = NSMenu(title: "Edit")
|
||||
menu.addItem(withTitle: "Undo", action: Selector(("undo:")), keyEquivalent: "z")
|
||||
let redo = menu.addItem(withTitle: "Redo", action: Selector(("redo:")), keyEquivalent: "z")
|
||||
menu.addItem(withTitle: "Undo", action: NSSelectorFromString("undo:"), keyEquivalent: "z")
|
||||
let redo = menu.addItem(withTitle: "Redo", action: NSSelectorFromString("redo:"), keyEquivalent: "z")
|
||||
redo.keyEquivalentModifierMask = [.command, .shift]
|
||||
menu.addItem(.separator())
|
||||
menu.addItem(withTitle: "Cut", action: #selector(NSText.cut(_:)), keyEquivalent: "x")
|
||||
menu.addItem(withTitle: "Copy", action: #selector(NSText.copy(_:)), keyEquivalent: "c")
|
||||
menu.addItem(withTitle: "Paste", action: #selector(NSText.paste(_:)), keyEquivalent: "v")
|
||||
let plain = menu.addItem(withTitle: "Paste as Plain Text", action: #selector(NSTextView.pasteAsPlainText(_:)), keyEquivalent: "v")
|
||||
plain.keyEquivalentModifierMask = [.command, .option, .shift]
|
||||
return menu
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user