mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-04-27 20:08:41 +03:00

Fixes #1052 This implements the about window as a custom window with a view controller. This lets us implement the proper responder chain so that our custom close window IBActions do the right thing. This has an additional benefit that we can easily customize this window going forward.
31 lines
752 B
Swift
31 lines
752 B
Swift
import SwiftUI
|
|
|
|
struct AboutView: View {
|
|
/// Read the commit from the bundle.
|
|
var commit: String {
|
|
guard let valueAny = Bundle.main.infoDictionary?["CFBundleVersion"],
|
|
let version = valueAny as? String else {
|
|
return "unknown"
|
|
}
|
|
|
|
return version
|
|
}
|
|
|
|
var body: some View {
|
|
VStack(alignment: .center) {
|
|
Image("AppIconImage")
|
|
.resizable()
|
|
.aspectRatio(contentMode: .fit)
|
|
.frame(maxHeight: 96)
|
|
|
|
Text("Ghostty")
|
|
.font(.title3)
|
|
|
|
Text("Commit: \(commit)")
|
|
.font(.body)
|
|
}
|
|
.frame(minWidth: 300)
|
|
.padding()
|
|
}
|
|
}
|