Fix incoming transmission capsule shape

This commit is contained in:
Leon Böttger committed 2025-11-05 11:16:39 +01:00
1 parent 261f91bc94
commit 31b93a34a2
2 files changed
+19 -7

No files matched your search

+4 -4
View File
@@ -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;
+15 -3
View File
@@ -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() }