mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-04-27 15:07:39 +00:00
Merge pull request #73 from RobotsAndPencils/matt/fixbuildMetadataIdentifiers
Don't show brackets when buildMetadataIdentifiers is empty
This commit is contained in:
commit
d834f3ed74
3 changed files with 13 additions and 4 deletions
|
|
@ -47,5 +47,9 @@ extension Version {
|
||||||
|
|
||||||
self.init(versionString)
|
self.init(versionString)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var buildMetadataIdentifiersDisplay: String {
|
||||||
|
return !buildMetadataIdentifiers.isEmpty ? "(\(buildMetadataIdentifiers.joined(separator: " ")))" : ""
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ struct InfoPane: View {
|
||||||
icon(for: xcode)
|
icon(for: xcode)
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text(verbatim: "Xcode \(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
Text(verbatim: "Xcode \(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
||||||
.font(.title)
|
.font(.title)
|
||||||
.frame(maxWidth: .infinity, alignment: .leading)
|
.frame(maxWidth: .infinity, alignment: .leading)
|
||||||
|
|
||||||
|
|
@ -254,11 +254,11 @@ struct InfoPane_Previews: PreviewProvider {
|
||||||
})
|
})
|
||||||
.previewDisplayName("Populated, Uninstalled")
|
.previewDisplayName("Populated, Uninstalled")
|
||||||
|
|
||||||
InfoPane(selectedXcodeID: Version(major: 12, minor: 3, patch: 0))
|
InfoPane(selectedXcodeID: Version(major: 12, minor: 3, patch: 1, buildMetadataIdentifiers: ["1234A"]))
|
||||||
.environmentObject(configure(AppState()) {
|
.environmentObject(configure(AppState()) {
|
||||||
$0.allXcodes = [
|
$0.allXcodes = [
|
||||||
.init(
|
.init(
|
||||||
version: Version(major: 12, minor: 3, patch: 0),
|
version: Version(major: 12, minor: 3, patch: 1, buildMetadataIdentifiers: ["1234A"]),
|
||||||
installState: .installed(Path("/Applications/Xcode-12.3.0.app")!),
|
installState: .installed(Path("/Applications/Xcode-12.3.0.app")!),
|
||||||
selected: false,
|
selected: false,
|
||||||
icon: nil,
|
icon: nil,
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@ struct XcodeListViewRow: View {
|
||||||
appIconView(for: xcode)
|
appIconView(for: xcode)
|
||||||
|
|
||||||
VStack(alignment: .leading) {
|
VStack(alignment: .leading) {
|
||||||
Text(verbatim: "\(xcode.description) (\(xcode.version.buildMetadataIdentifiers.joined(separator: " ")))")
|
Text(verbatim: "\(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
||||||
.font(.body)
|
.font(.body)
|
||||||
|
|
||||||
if case let .installed(path) = xcode.installState {
|
if case let .installed(path) = xcode.installState {
|
||||||
|
|
@ -122,6 +122,11 @@ struct XcodeListViewRow_Previews: PreviewProvider {
|
||||||
xcode: Xcode(version: Version("12.0.0")!, installState: .installed(Path("/Applications/Xcode-12.3.0.app")!), selected: false, icon: nil),
|
xcode: Xcode(version: Version("12.0.0")!, installState: .installed(Path("/Applications/Xcode-12.3.0.app")!), selected: false, icon: nil),
|
||||||
selected: false
|
selected: false
|
||||||
)
|
)
|
||||||
|
|
||||||
|
XcodeListViewRow(
|
||||||
|
xcode: Xcode(version: Version("12.0.0+1234A")!, installState: .installed(Path("/Applications/Xcode-12.3.0.app")!), selected: false, icon: nil),
|
||||||
|
selected: false
|
||||||
|
)
|
||||||
}
|
}
|
||||||
.environmentObject(AppState())
|
.environmentObject(AppState())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue