feat: focus delete in note confirmation
This commit is contained in:
@@ -517,8 +517,12 @@ final class NotesController: NSViewController, NSTextViewDelegate {
|
||||
alert.alertStyle = .warning
|
||||
alert.messageText = "Delete “\(noteTitle.stringValue)”?"
|
||||
alert.informativeText = "This permanently deletes the note and its embedded images. This cannot be undone."
|
||||
alert.addButton(withTitle: "Cancel")
|
||||
alert.addButton(withTitle: "Delete Note").hasDestructiveAction = true
|
||||
alert.addButton(withTitle: "Cancel").keyEquivalent = "\u{1b}"
|
||||
let delete = alert.addButton(withTitle: "Delete Note")
|
||||
delete.contentTintColor = .systemRed
|
||||
delete.keyEquivalent = "\r"
|
||||
alert.window.initialFirstResponder = delete
|
||||
alert.window.defaultButtonCell = delete.cell as? NSButtonCell
|
||||
alert.beginSheetModal(for: window) { [weak self] response in
|
||||
guard let self else { return }
|
||||
defer { self.focusEditor() }
|
||||
|
||||
Reference in New Issue
Block a user