taler-ios

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

commit 251508dea517b498d79798c511b8411e35ab74b7
parent f9b475800b840db4c5641c722ae1bffc77143236
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 11 Jun 2026 15:59:37 +0200

SettingsButton in Toolbar top-trailing

Diffstat:
MTalerWallet1/Views/Actions/ActionsSheet.swift | 26++++++--------------------
MTalerWallet1/Views/Balances/BalancesListView.swift | 42+++++++++++++++++++++++++++++++++---------
2 files changed, 39 insertions(+), 29 deletions(-)

diff --git a/TalerWallet1/Views/Actions/ActionsSheet.swift b/TalerWallet1/Views/Actions/ActionsSheet.swift @@ -101,11 +101,6 @@ struct ActionsSheet: View { } return false } - @MainActor - func dismissAndPost() { - dismissTop(stack.push()) - NotificationCenter.default.post(name: .SettingsAction, object: nil) // will trigger NavigationLink - } var body: some View { VStack { @@ -146,24 +141,15 @@ struct ActionsSheet: View { .accessibility(sortPriority: 0) // read this last HStack { if #available(iOS 26.0, *) { - SettingsButton(accessibilityLabelStr: TalerTab.settings.title, - action: dismissAndPost) -// .padding() - .buttonStyle(TalerButtonStyle(type: .bordered, - dimmed: false, - narrow: true, - disabled: false, - aligned: .center)) - .accessibility(sortPriority: 0) // read this last if !pasteAutomatically { + let isEnabled = UIPasteboard.general.hasURLs PasteButton(accessibilityLabelStr: "Paste") { TalerWallet1App().inspectPasteboard(playSound: true) - } - .buttonStyle(TalerButtonStyle(type: .bordered, - dimmed: false, - narrow: true, - disabled: false, - aligned: .center)) + }.buttonStyle(TalerButtonStyle(type: .bordered, + dimmed: false, + narrow: true, + disabled: !isEnabled, + aligned: .center)) .accessibility(sortPriority: 1) } Spacer(minLength: 8) diff --git a/TalerWallet1/Views/Balances/BalancesListView.swift b/TalerWallet1/Views/Balances/BalancesListView.swift @@ -37,16 +37,10 @@ struct BalancesListView: View { await controller.loadBalances(stack.push("refreshing balances"), model) } - var body: some View { -#if PRINT_CHANGES - let _ = Self._printChanges() - let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear -#endif - /// In standard mode, selectedBalance just sets a "preference" which balance to pre-select for Actions. - /// However, the user can select another balance (with the picker) in each action - /// In OIM mode, the user selects a balance 'here' (in OIMView) when tapping on a savings box (representing the balance) + @ViewBuilder + func balancesList() -> some View { let count = controller.balances.count - List { + let list = List { if !controller.haveProdBalance && !controller.defaultExchanges.isEmpty { ProdSectionView(stack: stack.push(), isEmpty: false, disabled: false) } @@ -77,6 +71,36 @@ struct BalancesListView: View { await refresh() } .navigationTitle(title) + if #available(iOS 26.0, *) { + list + .toolbar { + ToolbarItem(placement: .primaryAction) { + Button { + NotificationCenter.default.post(name: .SettingsAction, object: nil) // will trigger NavigationLink + } label: { + Label(TalerTab.settings.title, systemImage: TalerTab.settings.sysImg) + .labelStyle(.iconOnly) + } + // .padding() + .buttonStyle(.glass) +// .accessibilitySortPriority(0) + } + } + } else { + list + } + } + + var body: some View { +#if PRINT_CHANGES + let _ = Self._printChanges() + let _ = symLog.vlog() // just to get the # to compare it with .onAppear & onDisappear +#endif + /// In standard mode, selectedBalance just sets a "preference" which balance to pre-select for Actions. + /// However, the user can select another balance (with the picker) in each action + /// In OIM mode, the user selects a balance 'here' (in OIMView) when tapping on a savings box (representing the balance) + + balancesList() .onChange(of: controller.oimModeActive) { oimModeActive in if !oimModeActive { print("🚩BalancesListView.onChange(of: oimModeActive) reset selectedBalance")