taler-ios

iOS apps for GNU Taler (wallet)
Log | Files | Refs | README | LICENSE

commit 5cb8039b4c67411f8bbba385318285aea2be5670
parent 8b8a226b8457d26904e5bba21a1460a52ae3afc2
Author: Marc Stibane <marc@taler.net>
Date:   Sat, 13 Jul 2024 18:39:38 +0200

Icons in transactions

Diffstat:
MTalerWallet1/Views/Transactions/TransactionDetailV.swift | 6++++++
MTalerWallet1/Views/Transactions/TransactionRowView.swift | 10++++++----
MTalerWallet1/Views/Transactions/TransactionSummaryV.swift | 6++++--
3 files changed, 16 insertions(+), 6 deletions(-)

diff --git a/TalerWallet1/Views/Transactions/TransactionDetailV.swift b/TalerWallet1/Views/Transactions/TransactionDetailV.swift @@ -18,10 +18,16 @@ struct TransactionDetailV: View { let info = details.info Section { if let posConfirmation = details.posConfirmation { + Text("Confirmation:") + .talerFont(.title3) + .listRowSeparator(.hidden) Text(posConfirmation) .talerFont(.body) } // Text(info.summary) + Text("Order-ID:") + .talerFont(.title3) + .listRowSeparator(.hidden) Text(info.orderId) .talerFont(.body) // Text(info.merchant.name) diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift @@ -42,13 +42,15 @@ struct TransactionRowView: View { let (dateString, date) = TalerDater.dateString(from: common.timestamp, relative: true) let incoming = common.incoming() - let foreColor = pending ? WalletColors().pendingColor(incoming) - : done ? WalletColors().transactionColor(incoming) - : WalletColors().uncompletedColor let textColor = doneOrPending ? .primary : colorScheme == .dark ? .secondary : increasedContrast ? Color(.darkGray) : .secondary // Color(.tertiaryLabel) + let refreshZero = common.type.isRefresh && common.amountEffective.isZero + let foreColor = refreshZero ? textColor + : pending ? WalletColors().pendingColor(incoming) + : done ? WalletColors().transactionColor(incoming) + : WalletColors().uncompletedColor let iconBadge = TransactionIconBadge(type: common.type, foreColor: foreColor, done: done, incoming: incoming, @@ -77,7 +79,7 @@ struct TransactionRowView: View { #endif let layout1 = HStack(spacing: 0) { - HStack(spacing: -4) { + HStack(spacing: 2) { iconBadge // Spacer(minLength: 0) VStack(alignment: .leading) { diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift @@ -127,9 +127,11 @@ struct TransactionSummaryV: View { : majorState : majorState HStack { - Text(verbatim: "|") // only reason for this leading-aligned text is to get a nice full length listRowSeparator + Text(Image(common.type.iconName())) +// Text(verbatim: "|") // only reason for this leading-aligned text is to get a nice full length listRowSeparator .accessibilityHidden(true) - .foregroundColor(Color.clear) +// .foregroundColor(Color.clear) +// Spacer() Text("Status: \(state)") .frame(maxWidth: .infinity, alignment: .trailing) .multilineTextAlignment(.trailing)