mirror of
https://github.com/XcodesOrg/XcodesApp.git
synced 2026-03-25 08:55:46 +00:00
49 lines
1.4 KiB
Swift
49 lines
1.4 KiB
Swift
import SwiftUI
|
|
import XcodesKit
|
|
|
|
struct InstallationStepDetailView: View {
|
|
let installationStep: XcodeInstallationStep
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 0) {
|
|
Text(String(format: localizeString("InstallationStepDescription"), installationStep.stepNumber, installationStep.stepCount, installationStep.message))
|
|
|
|
switch installationStep {
|
|
case let .downloading(progress):
|
|
ObservingProgressIndicator(
|
|
progress,
|
|
controlSize: .regular,
|
|
style: .bar,
|
|
showsAdditionalDescription: true
|
|
)
|
|
|
|
case .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
|
|
ProgressView()
|
|
.scaleEffect(0.5)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
#Preview("Downloading") {
|
|
InstallationStepDetailView(
|
|
installationStep: .downloading(
|
|
progress: configure(Progress()) {
|
|
$0.kind = .file
|
|
$0.fileOperationKind = .downloading
|
|
$0.estimatedTimeRemaining = 123
|
|
$0.totalUnitCount = 11944848484
|
|
$0.completedUnitCount = 848444920
|
|
$0.throughput = 9211681
|
|
}
|
|
)
|
|
)
|
|
.padding()
|
|
}
|
|
|
|
#Preview("Unarchiving") {
|
|
InstallationStepDetailView(
|
|
installationStep: .unarchiving
|
|
)
|
|
.padding()
|
|
}
|