gh-XcodesOrg-XcodesApp/Xcodes/Frontend/InfoPane/InstallationStepDetailView.swift
Brandon Evans 1469dfa56b
Replace ObservingDownloadStatsView with ObservingProgressIndicator
This more closely replicates the default look and feel of SwiftUI.ProgressView, but with explicit control over whether localizedAdditionalDescription is shown and without the label above the progress view that displays a fileOperationKind string.
2021-02-18 19:10:12 -07:00

36 lines
1.2 KiB
Swift

import SwiftUI
struct InstallationStepDetailView: View {
let installationStep: InstallationStep
var body: some View {
VStack {
switch installationStep {
case let .downloading(progress):
Text("Step \(installationStep.stepNumber) of \(installationStep.stepCount): \(installationStep.message)")
.font(.title2)
ObservingProgressIndicator(
progress,
controlSize: .regular,
style: .bar,
showsAdditionalDescription: true
)
case .unarchiving, .moving, .trashingArchive, .checkingSecurity, .finishing:
ProgressView()
.scaleEffect(0.5)
}
}
.frame(minWidth: 80)
}
}
struct InstallDetailView_Previews: PreviewProvider {
static var previews: some View {
InstallationStepDetailView(
installationStep: .downloading(
progress: configure(Progress(totalUnitCount: 100)) { $0.completedUnitCount = 40; $0.throughput = 9211681; $0.fileCompletedCount = 84844492; $0.fileTotalCount = 11944848484 }
)
)
}
}