[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 147/204: layout improvement
From: |
gnunet |
Subject: |
[taler-taler-ios] 147/204: layout improvement |
Date: |
Thu, 05 Dec 2024 23:51:55 +0100 |
This is an automated email from the git hooks/post-receive script.
marc-stibane pushed a commit to branch master
in repository taler-ios.
commit e4c14f0c95d0eb7ef958c9c8a5b22035cd15acf7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Nov 20 07:50:32 2024 +0100
layout improvement
---
TalerWallet1/Views/HelperViews/ScopePicker.swift | 42 ++++++++++++++----------
1 file changed, 25 insertions(+), 17 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/ScopePicker.swift
b/TalerWallet1/Views/HelperViews/ScopePicker.swift
index 9e8fcfb..d4d529c 100644
--- a/TalerWallet1/Views/HelperViews/ScopePicker.swift
+++ b/TalerWallet1/Views/HelperViews/ScopePicker.swift
@@ -44,7 +44,7 @@ struct ScopePicker: View {
let url = balance.scopeInfo.url?.trimURL ?? EMPTYSTRING
let a11yLabel = url + ", " + availableA11y
- HStack(alignment: .top) {
+ HStack(alignment: .firstTextBaseline) {
let disabled = (count == 1)
Text("via", comment: "ScopePicker")
.accessibilityHidden(true)
@@ -104,23 +104,29 @@ struct ScopeDropDown: View {
}
@ViewBuilder
- func dropDownRow(_ balance: Balance, _ currencyInfo: CurrencyInfo) -> some
View {
- let hLayout = HStack(alignment: .top) {
- Text(urlOrCurrency(balance))
- Spacer()
- Text(formattedAmount(balance, currencyInfo).nbs)
- }
- let vLayout = VStack(alignment: .leading) {
- Text(urlOrCurrency(balance))
- HStack {
- Spacer()
- Text(formattedAmount(balance, currencyInfo).nbs)
+ func dropDownRow(_ balance: Balance, _ currencyInfo: CurrencyInfo, _
first: Bool = false) -> some View {
+ let text = Text(urlOrCurrency(balance))
+ let amount = Text(formattedAmount(balance, currencyInfo).nbs)
+ if first {
+ text
+ } else {
+ let hLayout = HStack(alignment: .firstTextBaseline) {
+ text
Spacer()
+ amount
+ }.padding(.vertical, 4)
+ let vLayout = VStack(alignment: .leading) {
+ text
+ HStack {
+ Spacer()
+ amount
+ Spacer()
+ }
+ }
+ ViewThatFits(in: .horizontal) {
+ hLayout
+ vLayout
}
- }
- ViewThatFits(in: .horizontal) {
- hLayout
- vLayout
}
}
@@ -159,9 +165,10 @@ struct ScopeDropDown: View {
// selected item
let balance = controller.balances[selection]
let currencyInfo = controller.info(for: balance.scopeInfo,
controller.currencyTicker)
+ let noAmount = !showDropdown
Button(action: buttonAction) {
HStack(alignment: .firstTextBaseline) {
- dropDownRow(balance, currencyInfo)
+ dropDownRow(balance, currencyInfo, noAmount)
.accessibilityAddTraits(.isSelected)
Spacer()
if !disabled {
@@ -170,6 +177,7 @@ struct ScopeDropDown: View {
}
}
}
+ .padding(.vertical, 4)
.padding(.horizontal, radius / 2)
.frame(maxWidth: .infinity, alignment: .leading)
// .border(.red)
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 160/204: cleanup, (continued)
- [taler-taler-ios] 160/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 163/204: fix deposit, gnunet, 2024/12/05
- [taler-taler-ios] 165/204: get rid of P2P, gnunet, 2024/12/05
- [taler-taler-ios] 144/204: scope from balance, gnunet, 2024/12/05
- [taler-taler-ios] 135/204: Colors, gnunet, 2024/12/05
- [taler-taler-ios] 137/204: restrictScope, gnunet, 2024/12/05
- [taler-taler-ios] 139/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 143/204: prepare split, gnunet, 2024/12/05
- [taler-taler-ios] 141/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 149/204: summary for p2p, gnunet, 2024/12/05
- [taler-taler-ios] 147/204: layout improvement,
gnunet <=
- [taler-taler-ios] 155/204: ensure to pay only ONCE, gnunet, 2024/12/05
- [taler-taler-ios] 162/204: KnownBankAccounts, gnunet, 2024/12/05
- [taler-taler-ios] 159/204: getTransactionById, gnunet, 2024/12/05
- [taler-taler-ios] 178/204: remove etag, gnunet, 2024/12/05
- [taler-taler-ios] 148/204: dismiss only if done, gnunet, 2024/12/05
- [taler-taler-ios] 146/204: smaller tx icon in lists, gnunet, 2024/12/05
- [taler-taler-ios] 156/204: fix button position, gnunet, 2024/12/05
- [taler-taler-ios] 168/204: wording, gnunet, 2024/12/05
- [taler-taler-ios] 170/204: cleanup, gnunet, 2024/12/05
- [taler-taler-ios] 169/204: debug, gnunet, 2024/12/05