mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
Add identical builds indicator to XcodeListViewRow
This commit is contained in:
parent
70872f441a
commit
ef646b7b88
2 changed files with 14 additions and 2 deletions
|
|
@ -44,6 +44,7 @@ struct XcodeListView_Previews: PreviewProvider {
|
|||
.environmentObject({ () -> AppState in
|
||||
let a = AppState()
|
||||
a.allXcodes = [
|
||||
Xcode(version: Version("12.0.0+1234A")!, identicalBuilds: [Version("12.0.0+1234A")!, Version("12.0.0-RC+1234A")!], installState: .installed(Path("/Applications/Xcode-12.3.0.app")!), selected: false, icon: nil),
|
||||
Xcode(version: Version("12.3.0")!, installState: .installed(Path("/Applications/Xcode-12.3.0.app")!), selected: true, icon: nil),
|
||||
Xcode(version: Version("12.2.0")!, installState: .notInstalled, selected: false, icon: nil),
|
||||
Xcode(version: Version("12.1.0")!, installState: .installing(.downloading(progress: configure(Progress(totalUnitCount: 100)) { $0.completedUnitCount = 40 })), selected: false, icon: nil),
|
||||
|
|
|
|||
|
|
@ -12,8 +12,19 @@ struct XcodeListViewRow: View {
|
|||
appIconView(for: xcode)
|
||||
|
||||
VStack(alignment: .leading) {
|
||||
Text(verbatim: "\(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
||||
.font(.body)
|
||||
HStack {
|
||||
Text(verbatim: "\(xcode.description) \(xcode.version.buildMetadataIdentifiersDisplay)")
|
||||
.font(.body)
|
||||
|
||||
if !xcode.identicalBuilds.isEmpty {
|
||||
Image(systemName: "square.fill.on.square.fill")
|
||||
.font(.subheadline)
|
||||
.foregroundColor(.secondary)
|
||||
.accessibility(label: Text("Identical Builds"))
|
||||
.accessibility(value: Text(xcode.identicalBuilds.map(\.appleDescription).joined(separator: ", ")))
|
||||
.help("Sometimes a prerelease and release version are the exact same build. Xcodes will automatically display these versions together.")
|
||||
}
|
||||
}
|
||||
|
||||
if case let .installed(path) = xcode.installState {
|
||||
Text(verbatim: path.string)
|
||||
|
|
|
|||
Loading…
Reference in a new issue