[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 41/204: ScopePicker
From: |
gnunet |
Subject: |
[taler-taler-ios] 41/204: ScopePicker |
Date: |
Thu, 05 Dec 2024 23:50:09 +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 acf36f6af1c6641a65ffed578375b62eadbb7252
Author: Marc Stibane <marc@taler.net>
AuthorDate: Sat Oct 12 11:20:12 2024 +0200
ScopePicker
---
TalerWallet1/Helper/Font+Taler.swift | 1 +
TalerWallet1/Views/HelperViews/ScopePicker.swift | 32 +++++++++++-------------
2 files changed, 16 insertions(+), 17 deletions(-)
diff --git a/TalerWallet1/Helper/Font+Taler.swift
b/TalerWallet1/Helper/Font+Taler.swift
index 7408719..c307778 100644
--- a/TalerWallet1/Helper/Font+Taler.swift
+++ b/TalerWallet1/Helper/Font+Taler.swift
@@ -174,6 +174,7 @@ extension TalerFont { // old running
static var title: TalerFont { TalerFont(fontName, size: 28,
relativeTo: .title) } // 28 -> 31
static var title2: TalerFont { TalerFont(fontName, size: 22,
relativeTo: .title2) } // 22 -> 25
static var title3: TalerFont { TalerFont(fontName, size: 20,
relativeTo: .title3) } // 20 -> 23
+ static var picker: TalerFont { TalerFont(fontName, size: 18,
relativeTo: .body) } // picker uses a different size!
static var headline: TalerFont { TalerFont(fontName, size: 17,
relativeTo: .headline, isBold: true) } // 17 bold -> 19 bold
static var body: TalerFont { TalerFont(fontName, size: 17,
relativeTo: .body) } // 17 -> 19
static var callout: TalerFont { TalerFont(fontName, size: 16,
relativeTo: .callout) } // 16 -> 18
diff --git a/TalerWallet1/Views/HelperViews/ScopePicker.swift
b/TalerWallet1/Views/HelperViews/ScopePicker.swift
index 8d66090..94afc09 100644
--- a/TalerWallet1/Views/HelperViews/ScopePicker.swift
+++ b/TalerWallet1/Views/HelperViews/ScopePicker.swift
@@ -19,34 +19,32 @@ struct ScopePicker: View {
return amount.formatted(isNegative: false, useISO: false)
}
- func label(balance: Balance) -> String {
- let label = balance.scopeInfo.url?.trimURL
- ?? balance.scopeInfo.currency
- return String("\(label):\t\(formattedAmount(balance).nbs)")
+ func row(_ balance: Balance) -> String {
+ let urlOrCurrency = balance.scopeInfo.url?.trimURL
+ ?? balance.scopeInfo.currency
+ return String("\(urlOrCurrency):\t\(formattedAmount(balance).nbs)")
}
var body: some View {
- HStack {
- Text("Use: ", comment: "ScopePicker")
- Spacer()
- if (balances.count > 0) {
+ if (balances.count > 0) {
+ Group {
Picker(EMPTYSTRING, selection: $selected) {
ForEach(0..<balances.count, id: \.self) { index in
- Text(label(balance: balances[index]))
+ Text(row(balances[index]))
.tag(index)
}
}
+ .frame(width: .infinity)
.pickerStyle(.menu)
- .onAppear() {
- withAnimation { selected = value }
- }
- .onChange(of: selected) { newValue in
- action(newValue)
- }
+ .labelsHidden()
+ }
+ .onAppear() {
+ withAnimation { selected = value }
+ }
+ .onChange(of: selected) { newValue in
+ action(newValue)
}
}
- .padding(.leading)
- .talerFont(.title3)
}
}
// MARK: -
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 61/204: arrrow names & icons, (continued)
- [taler-taler-ios] 61/204: arrrow names & icons, gnunet, 2024/12/05
- [taler-taler-ios] 34/204: hideSpendingHint, gnunet, 2024/12/05
- [taler-taler-ios] 65/204: ScopeDropDown, gnunet, 2024/12/05
- [taler-taler-ios] 66/204: cleanup, remove warning, gnunet, 2024/12/05
- [taler-taler-ios] 28/204: dropBar, padding, gnunet, 2024/12/05
- [taler-taler-ios] 27/204: dismiss, gnunet, 2024/12/05
- [taler-taler-ios] 25/204: layout - smaller font, gnunet, 2024/12/05
- [taler-taler-ios] 36/204: QRButton in Actions, gnunet, 2024/12/05
- [taler-taler-ios] 29/204: getMaxPeerPushDebitAmountM for available, gnunet, 2024/12/05
- [taler-taler-ios] 39/204: A11y for amounts, gnunet, 2024/12/05
- [taler-taler-ios] 41/204: ScopePicker,
gnunet <=
- [taler-taler-ios] 35/204: layout itself, gnunet, 2024/12/05
- [taler-taler-ios] 38/204: hint instead of warning, gnunet, 2024/12/05
- [taler-taler-ios] 42/204: no GradientBorder, gnunet, 2024/12/05
- [taler-taler-ios] 46/204: no subject, gnunet, 2024/12/05
- [taler-taler-ios] 48/204: DragGesture, gnunet, 2024/12/05
- [taler-taler-ios] 54/204: tabBar+QR, gnunet, 2024/12/05
- [taler-taler-ios] 52/204: QRButton gets camera API, gnunet, 2024/12/05
- [taler-taler-ios] 57/204: innerSize, gnunet, 2024/12/05
- [taler-taler-ios] 58/204: ScopePicker, gnunet, 2024/12/05
- [taler-taler-ios] 62/204: a11y, gnunet, 2024/12/05