mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-02 16:08:39 +00:00
macos: quit if we have no visible windows
This commit is contained in:
@@ -1,6 +1,9 @@
|
||||
import SwiftUI
|
||||
|
||||
struct SettingsView: View {
|
||||
// We need access to our app delegate to know if we're quitting or not.
|
||||
@EnvironmentObject private var appDelegate: AppDelegate
|
||||
|
||||
var body: some View {
|
||||
HStack {
|
||||
Image("AppIconImage")
|
||||
@@ -18,6 +21,10 @@ struct SettingsView: View {
|
||||
}
|
||||
.padding()
|
||||
.frame(minWidth: 500, maxWidth: 500, minHeight: 156, maxHeight: 156)
|
||||
.onChange(of: appDelegate.confirmQuit) { value in
|
||||
guard value else { return }
|
||||
NSApplication.shared.reply(toApplicationShouldTerminate: true)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user