mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macOS: change quit dialog to handle return by removing role
This is, as it turns out, the simple version of #166. It changes the quit dialog to handle return by removing the `.destructive` role from the `Quit` button. When that role is set, the `keyboardShortcut(.defaultAction)` doesn't have an effect. With the role removed, the dialog handles the return key to quit the application As I wrote in #166, I can understand if you don't want this change, but I personally think it's nice to be able to only use the keyboard. iTerm2 also handles return like this in the "Are you sure?" dialog.
This commit is contained in:
@ -38,7 +38,7 @@ struct ContentView: View {
|
|||||||
.confirmationDialog(
|
.confirmationDialog(
|
||||||
"Quit Ghostty?",
|
"Quit Ghostty?",
|
||||||
isPresented: confirmQuitting) {
|
isPresented: confirmQuitting) {
|
||||||
Button("Close Ghostty", role: .destructive) {
|
Button("Close Ghostty") {
|
||||||
NSApplication.shared.reply(toApplicationShouldTerminate: true)
|
NSApplication.shared.reply(toApplicationShouldTerminate: true)
|
||||||
}
|
}
|
||||||
.keyboardShortcut(.defaultAction)
|
.keyboardShortcut(.defaultAction)
|
||||||
|
Reference in New Issue
Block a user