commit 3c704b6642e21ca3f47843f9f55f2f730c916505
parent 54c9f6164f2fb87aa409d4bc36179475af769f57
Author: Marc Stibane <marc@taler.net>
Date: Thu, 21 Nov 2024 21:55:40 +0100
fix badge
Diffstat:
2 files changed, 11 insertions(+), 11 deletions(-)
diff --git a/TalerWallet1/Helper/Font+Taler.swift b/TalerWallet1/Helper/Font+Taler.swift
@@ -181,6 +181,7 @@ extension TalerFont { // old running
static var subheadline: TalerFont { TalerFont(fontName, size: 15, relativeTo: .subheadline) } // 15 -> 17
static var footnote: TalerFont { TalerFont(fontName, size: 13, relativeTo: .footnote) } // 13 -> 15
static var caption: TalerFont { TalerFont(fontName, size: 12, relativeTo: .caption) } // 12 -> 13
+ static var badge: TalerFont { TalerFont(fontName, size: 10, relativeTo: .caption) } // 12 -> 13
}
struct StyleSizeBoldViewModifier: ViewModifier {
diff --git a/TalerWallet1/Views/HelperViews/IconBadge.swift b/TalerWallet1/Views/HelperViews/IconBadge.swift
@@ -72,7 +72,7 @@ struct IconBadge: View {
let wideIcon: Image? // cheating: ZStack with widest icon to ensure all have the same width
// TODO: EqualIconWidth...
- @ScaledMetric var spacing = 8 // relative to fontSize
+ @ScaledMetric var spacing = 6 // relative to fontSize
var body: some View {
HStack(alignment: .top, spacing: -spacing) {
@@ -82,16 +82,15 @@ struct IconBadge: View {
}
image.foregroundColor(foreColor)
}.talerFont(.title2)
- if wideIcon == nil {
- // ZStack centers the main icon, so the badge will always be at the same position
- let badgeName = needsKYC ? NEEDS_KYC
- : CONFIRM_BANK
- Image(systemName: badgeName)
- .talerFont(.caption)
- .foregroundColor(needsKYC ? WalletColors().attention
- : shouldConfirm ? WalletColors().confirm
- : .clear)
- }
+ // ZStack centers the main icon, so the badge will always be at the same position
+ let badgeName = needsKYC ? NEEDS_KYC
+ : CONFIRM_BANK
+ Image(systemName: badgeName)
+ .talerFont(.badge)
+ .foregroundColor(needsKYC ? WalletColors().attention
+ : shouldConfirm ? WalletColors().confirm
+ : .clear)
+ .padding(.top, -2)
}.accessibilityHidden(true)
}
}