diff --git a/QuickDrop.xcodeproj/project.pbxproj b/QuickDrop.xcodeproj/project.pbxproj index 496af5d..f87456b 100644 --- a/QuickDrop.xcodeproj/project.pbxproj +++ b/QuickDrop.xcodeproj/project.pbxproj @@ -1267,8 +1267,8 @@ MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; SDKROOT = macosx; - SHARED_BUILD = 80; - SHARED_VERSION = 2.5.1; + SHARED_BUILD = 81; + SHARED_VERSION = 2.5.2; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_ACTIVE_COMPILATION_CONDITIONS = DEBUG; SWIFT_EMIT_LOC_STRINGS = YES; @@ -1330,8 +1330,8 @@ MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = macosx; - SHARED_BUILD = 80; - SHARED_VERSION = 2.5.1; + SHARED_BUILD = 81; + SHARED_VERSION = 2.5.2; STRING_CATALOG_GENERATE_SYMBOLS = YES; SWIFT_COMPILATION_MODE = wholemodule; SWIFT_EMIT_LOC_STRINGS = YES; diff --git a/QuickDrop/View/QuickDropToastView.swift b/QuickDrop/View/QuickDropToastView.swift index 50efa6c..3b4a538 100644 --- a/QuickDrop/View/QuickDropToastView.swift +++ b/QuickDrop/View/QuickDropToastView.swift @@ -110,11 +110,17 @@ struct CapsuleProgress: View { var body: some View { GeometryReader { geo in + let progress = max(0, min(1, value)) ZStack(alignment: .leading) { - Capsule().fill(track) Capsule() + .fill(track) + Capsule() // Use a plain rectangle .fill(fill) - .frame(width: max(0, min(1, value)) * geo.size.width) + .mask( + Capsule() + .frame(width: progress * geo.size.width) + .frame(maxWidth: .infinity, alignment: .leading) + ) } } .frame(height: 8) @@ -126,13 +132,19 @@ struct CapsuleProgress: View { // MARK: - Preview struct QuickDropToastView_Previews: PreviewProvider { struct Demo: View { + + @State var model = ReceiveModel() + var body: some View { QuickDropToastView( - receiveModel: ReceiveModel(), + receiveModel: model, onCancel: { } ) .padding() .frame(width: toastViewSize.width, height: toastViewSize.height) + .onAppear { + model.progress = 0.01 + } } } static var previews: some View { Demo() }