commit 12f6865d087ac7a9210728e6fe055e08e60b9717
parent 673d108a0805294e26478e994490bcd61fe36436
Author: Marc Stibane <marc@taler.net>
Date: Sun, 11 Feb 2024 14:35:56 +0100
remove Spacers
Diffstat:
11 files changed, 27 insertions(+), 51 deletions(-)
diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -19,10 +19,8 @@ struct BalanceCell: View {
var body: some View {
let amountV = AmountV(amount: amount, large: true)
.foregroundColor(.primary)
- let hLayout = HStack(spacing: 0) {
- Spacer(minLength: 0)
- amountV
- }
+ let hLayout = amountV
+ .frame(maxWidth: .infinity, alignment: .trailing)
let balanceCell = Group {
if minimalistic {
hLayout
diff --git a/TalerWallet1/Views/Balances/PendingRowView.swift b/TalerWallet1/Views/Balances/PendingRowView.swift
@@ -41,8 +41,7 @@ struct PendingRowView: View {
Text(pendingTitle.tabbed(oneLine: true))
HStack {
iconBadge
- Spacer(minLength: 0)
- amountText
+ amountText.frame(maxWidth: .infinity, alignment: .trailing)
}
}
@@ -51,8 +50,7 @@ struct PendingRowView: View {
HStack {
iconBadge
Text(pendingTitle.tabbed(oneLine: false))
- Spacer(minLength: 0)
- amountText
+ amountText.frame(maxWidth: .infinity, alignment: .trailing)
}
vStack
VStack {
diff --git a/TalerWallet1/Views/HelperViews/AgePicker.swift b/TalerWallet1/Views/HelperViews/AgePicker.swift
@@ -29,12 +29,11 @@ struct AgePicker: View {
var body: some View {
if ageMenuList.count > 1 {
VStack {
- HStack {
- Text("If this wallet belongs to a child or teenager, the generated electronic cash should be age-restricted:")
- .multilineTextAlignment(.leading)
+ Text("If this wallet belongs to a child or teenager, the generated electronic cash should be age-restricted:")
+ .frame(maxWidth: .infinity, alignment: .leading)
+ .multilineTextAlignment(.leading)
.talerFont(.footnote)
- Spacer()
- }.padding(.top)
+ .padding(.top)
Picker("Select age", selection: $selectedAge) {
ForEach($ageMenuList, id: \.self) { item in
let index = item.wrappedValue
diff --git a/TalerWallet1/Views/HelperViews/CurrencyInputView.swift b/TalerWallet1/Views/HelperViews/CurrencyInputView.swift
@@ -80,13 +80,11 @@ struct CurrencyInputView: View {
let currencyInfo = controller.info(for: currency, controller.currencyTicker)
let currencyField = CurrencyField(amount: $amount, currencyInfo: currencyInfo)
VStack (alignment: .center) { // center shortcut buttons
- HStack {
Text(title)
+ .frame(maxWidth: .infinity, alignment: .leading)
.talerFont(.title3)
.accessibilityAddTraits(.isHeader)
.accessibilityRemoveTraits(.isStaticText)
- Spacer()
- }
currencyField
.frame(maxWidth: .infinity, alignment: .trailing)
.foregroundColor(WalletColors().fieldForeground) // text color
diff --git a/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift b/TalerWallet1/Views/HelperViews/QRCodeDetailView.swift
@@ -33,26 +33,20 @@ struct QRCodeDetailView: View {
.talerFont(.title3)
// .padding(.vertical)
.listRowSeparator(.hidden)
-
CopyShare(textToCopy: talerURI)
.disabled(false)
// .padding(.bottom)
.listRowSeparator(.hidden)
-
let otherParty = incoming ? String(localized: "the payment link to the payer, or")
: String(localized: "the payment link to the payee, or")
Text(otherParty)
.multilineTextAlignment(.leading)
.talerFont(.title3)
.listRowSeparator(.hidden)
-
- HStack {
- Spacer()
- QRGeneratorView(text: talerURI)
- .accessibilityLabel("QR Code")
- Spacer()
- }
- .listRowSeparator(.hidden)
+ QRGeneratorView(text: talerURI)
+ .frame(maxWidth: .infinity, alignment: .center)
+ .accessibilityLabel("QR Code")
+ .listRowSeparator(.hidden)
let hintStr = incoming ? String(localized: "let the payer scan this QR code to pay \(amountStr).",
comment: "e.g. '5,3 €'")
diff --git a/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift b/TalerWallet1/Views/Peer2peer/P2PSubjectV.swift
@@ -58,12 +58,10 @@ struct P2PSubjectV: View {
ScrollView { VStack (alignment: .leading, spacing: 6) {
let label = feeLabel ?? myFeeLabel
if label.count > 0 {
- HStack {
- Spacer()
Text(label)
.foregroundColor(.red)
+ .frame(maxWidth: .infinity, alignment: .trailing)
.talerFont(.body)
- }
}
if !minimalistic {
Text("Enter subject:") // Purpose
@@ -92,12 +90,10 @@ struct P2PSubjectV: View {
symLog.log("...kbd isFocused")
}
}
- HStack{
- Spacer()
- Text(verbatim: "\(summary.count)/100")
+ Text(verbatim: "\(summary.count)/100") // maximum 100 characters
+ .frame(maxWidth: .infinity, alignment: .trailing)
.talerFont(.body)
.accessibilityValue("\(summary.count) characters of 100")
- } // maximum 100 characters
// TODO: compute max Expiration day from peerPushCheck to disable 30 (and even 7)
SelectDays(selected: $expireDays, maxExpiration: THIRTYDAYS)
diff --git a/TalerWallet1/Views/Settings/AboutView.swift b/TalerWallet1/Views/Settings/AboutView.swift
@@ -32,12 +32,9 @@ struct AboutView: View {
let walletCore = WalletCore.shared
Group {
List {
- HStack {
- Spacer()
RotatingTaler(size: 100, rotationEnabled: $rotationEnabled)
+ .frame(maxWidth: .infinity, alignment: .center)
.onTapGesture(count: 1) { rotationEnabled.toggle() }
- Spacer()
- }
SettingsItem(name: "Visit the taler.net website", id1: "web",
description: minimalistic ? nil : String(localized: "More info about Gnu Taler in general...")) { }
.accessibilityAddTraits(.isLink)
diff --git a/TalerWallet1/Views/Transactions/ManualDetailsV.swift b/TalerWallet1/Views/Transactions/ManualDetailsV.swift
@@ -105,7 +105,7 @@ struct ManualDetailsV: View {
Text(details.reservePub)
.monospacedDigit()
.accessibilityLabel("Cryptocode")
- Spacer()
+ .frame(maxWidth: .infinity, alignment: .leading)
CopyButton(textToCopy: details.reservePub, vertical: true)
.accessibilityLabel("Copy the cryptocode")
.disabled(false)
@@ -114,7 +114,7 @@ struct ManualDetailsV: View {
Text(iban)
.monospacedDigit()
.accessibilityLabel("IBAN of the exchange")
- Spacer()
+ .frame(maxWidth: .infinity, alignment: .leading)
CopyButton(textToCopy: iban, vertical: true)
.accessibilityLabel("Copy the IBAN")
.disabled(false)
@@ -158,11 +158,12 @@ struct ManualDetailsV: View {
Text(verbatim: "|") // only reason for this leading-aligned text is to get a nice full length listRowSeparator
.accessibilityHidden(true)
.foregroundColor(Color.clear)
- Spacer()
+// Spacer()
ShareButton(textToShare: payto)
+ .frame(maxWidth: .infinity, alignment: .center)
.accessibilityLabel("Share the PayTo URL")
.disabled(false)
- Spacer()
+// Spacer()
} .listRowSeparator(.automatic)
}.id(listID)
.talerFont(.body)
diff --git a/TalerWallet1/Views/Transactions/ThreeAmountsV.swift b/TalerWallet1/Views/Transactions/ThreeAmountsV.swift
@@ -111,15 +111,13 @@ struct ThreeAmountsV: View {
Text(minimalistic ? "Payment provider:" : "Using payment service provider:")
.multilineTextAlignment(.leading)
.talerFont(.body)
- HStack {
- Spacer()
Text(baseURL.trimURL())
+ .frame(maxWidth: .infinity, alignment: .trailing)
.multilineTextAlignment(.center)
.talerFont(large ? .title3 : .body)
// .fontWeight(large ? .medium : .regular) // @available(iOS 16.0, *)
.foregroundColor(labelColor)
}
- }
.padding(.top, 4)
.frame(maxWidth: .infinity, alignment: .leading)
.listRowSeparator(.hidden)
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -95,14 +95,14 @@ struct TransactionRowView: View {
let layout1 = HStack(spacing: 0) {
HStack(spacing: -4) {
iconBadge
- Spacer(minLength: 0)
+// Spacer(minLength: 0)
VStack(alignment: .leading) {
centerTop
centerBottom
}
Spacer(minLength: 2)
}
- amountV
+ amountV //.frame(maxWidth: .infinity, alignment: .trailing)
}
let layout2 = VStack(spacing: 0) {
diff --git a/TalerWallet1/Views/Transactions/TransactionSummaryV.swift b/TalerWallet1/Views/Transactions/TransactionSummaryV.swift
@@ -131,8 +131,8 @@ struct TransactionSummaryV: View {
Text(verbatim: "|") // only reason for this leading-aligned text is to get a nice full length listRowSeparator
.accessibilityHidden(true)
.foregroundColor(Color.clear)
- Spacer()
Text("Status: \(state)")
+ .frame(maxWidth: .infinity, alignment: .trailing)
.multilineTextAlignment(.trailing)
}
} .listRowSeparator(.automatic)
@@ -254,11 +254,8 @@ struct TransactionSummaryV: View {
let title = EMPTYSTRING
Text(title)
.talerFont(.body)
- HStack {
- Spacer()
RotatingTaler(size: 100, rotationEnabled: $rotationEnabled)
- Spacer()
- }
+ .frame(maxWidth: .infinity, alignment: .center)
case .withdrawal(let withdrawalTransaction): Group {
let details = withdrawalTransaction.details
if pending {