gh-XcodesOrg-XcodesApp/Xcodes/Frontend/About/AboutView.swift
Brandon Evans 6b5a64010e
Add bug report and feature request options to Help menu
This will support error messages that instruct the user to go to the Help menu for these things.
2021-01-25 19:23:50 -07:00

46 lines
1.5 KiB
Swift

import SwiftUI
struct AboutView: View {
let showAcknowledgementsWindow: () -> Void
@SwiftUI.Environment(\.openURL) var openURL: OpenURLAction
var body: some View {
HStack {
Image(nsImage: NSApp.applicationIconImage)
VStack(alignment: .leading) {
Text(Bundle.main.bundleName!)
.font(.largeTitle)
Text("Version \(Bundle.main.shortVersion!) (\(Bundle.main.version!))")
Color.clear
.frame(width: 300, height: 16)
HStack(spacing: 32) {
Button(action: {
openURL(URL(string: "https://github.com/RobotsAndPencils/XcodesApp/")!)
}) {
Label("GitHub Repo", systemImage: "link")
}
.buttonStyle(LinkButtonStyle())
Button(action: showAcknowledgementsWindow) {
Label("Acknowledgements", systemImage: "doc")
}
.buttonStyle(LinkButtonStyle())
}
Text(Bundle.main.humanReadableCopyright!)
.font(.footnote)
}
}
.padding()
}
}
struct AboutView_Previews: PreviewProvider {
static var previews: some View {
AboutView(showAcknowledgementsWindow: {})
}
}