gh-XcodesOrg-XcodesApp/Xcodes/Frontend/InfoPane/InstallationStepDetailView.swift
2021-02-13 21:23:22 -06:00

35 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)
ObservingDownloadStatsView(
progress,
controlSize: .regular,
style: .bar
)
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 }
)
)
}
}