macos: add "Docs" button to the About window

This commit is contained in:
Mitchell Hashimoto
2024-12-20 09:10:54 -08:00
parent 2b352c0349
commit 330bbd0502

View File

@ -4,6 +4,7 @@ struct AboutView: View {
@Environment(\.openURL) var openURL
private let githubURL = URL(string: "https://github.com/ghostty-org/ghostty")
private let docsURL = URL(string: "https://ghostty.org/docs")
/// Read the commit from the bundle.
private var build: String? { Bundle.main.infoDictionary?["CFBundleVersion"] as? String }
@ -77,12 +78,16 @@ struct AboutView: View {
.frame(maxWidth: .infinity)
HStack(spacing: 8) {
if let url = docsURL {
Button("Docs") {
openURL(url)
}
}
if let url = githubURL {
Button("GitHub") {
openURL(url)
}
}
}
if let copy = self.copyright {