mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: add "Docs" button to the About window
This commit is contained in:
@ -4,6 +4,7 @@ struct AboutView: View {
|
|||||||
@Environment(\.openURL) var openURL
|
@Environment(\.openURL) var openURL
|
||||||
|
|
||||||
private let githubURL = URL(string: "https://github.com/ghostty-org/ghostty")
|
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.
|
/// Read the commit from the bundle.
|
||||||
private var build: String? { Bundle.main.infoDictionary?["CFBundleVersion"] as? String }
|
private var build: String? { Bundle.main.infoDictionary?["CFBundleVersion"] as? String }
|
||||||
@ -77,12 +78,16 @@ struct AboutView: View {
|
|||||||
.frame(maxWidth: .infinity)
|
.frame(maxWidth: .infinity)
|
||||||
|
|
||||||
HStack(spacing: 8) {
|
HStack(spacing: 8) {
|
||||||
|
if let url = docsURL {
|
||||||
|
Button("Docs") {
|
||||||
|
openURL(url)
|
||||||
|
}
|
||||||
|
}
|
||||||
if let url = githubURL {
|
if let url = githubURL {
|
||||||
Button("GitHub") {
|
Button("GitHub") {
|
||||||
openURL(url)
|
openURL(url)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if let copy = self.copyright {
|
if let copy = self.copyright {
|
||||||
|
Reference in New Issue
Block a user