From 8f48b073c49e80e0bad7ac2eac917a99152b3eb4 Mon Sep 17 00:00:00 2001 From: yoshikazu Date: Mon, 27 Jul 2026 15:42:25 +0000 Subject: [PATCH] Add scan progress view --- Sources/Photochk/Views/ScanProgressView.swift | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 Sources/Photochk/Views/ScanProgressView.swift diff --git a/Sources/Photochk/Views/ScanProgressView.swift b/Sources/Photochk/Views/ScanProgressView.swift new file mode 100644 index 0000000..f6661a2 --- /dev/null +++ b/Sources/Photochk/Views/ScanProgressView.swift @@ -0,0 +1,29 @@ +import SwiftUI + +struct ScanProgressView: View { + let progress: ScanProgress + let onCancel: () -> Void + + var body: some View { + VStack(spacing: 14) { + if let fraction = progress.fractionCompleted { + ProgressView(value: fraction) { + Text(progress.phase.label) + } currentValueLabel: { + Text(progress.detailText) + .monospacedDigit() + } + } else { + ProgressView { + Text(progress.phase.label) + } + } + + Button("中止", role: .cancel, action: onCancel) + } + .frame(width: 300) + .padding(24) + .background(.regularMaterial, in: RoundedRectangle(cornerRadius: 14, style: .continuous)) + .shadow(radius: 20) + } +}