Skip to content

Commit 5a6a11e

Browse files
committed
fix: quit dialog — Cancel as blue default (Return), Quit Anyway as destructive (red)
1 parent 601a7c9 commit 5a6a11e

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

TablePro/AppDelegate.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,11 @@ class AppDelegate: NSObject, NSApplicationDelegate {
204204
alert.messageText = String(localized: "You have unsaved changes")
205205
alert.informativeText = String(localized: "Some tabs have unsaved edits. Quitting will discard these changes.")
206206
alert.alertStyle = .warning
207-
alert.addButton(withTitle: String(localized: "Quit Anyway"))
208207
alert.addButton(withTitle: String(localized: "Cancel"))
209-
alert.buttons[0].hasDestructiveAction = true
210-
alert.buttons[1].keyEquivalent = "\r"
208+
alert.addButton(withTitle: String(localized: "Quit Anyway"))
209+
alert.buttons[1].hasDestructiveAction = true
211210
let response = alert.runModal()
212-
return response == .alertFirstButtonReturn ? .terminateNow : .terminateCancel
211+
return response == .alertSecondButtonReturn ? .terminateNow : .terminateCancel
213212
}
214213

215214
func applicationWillTerminate(_ notification: Notification) {

0 commit comments

Comments
 (0)