taler-ios

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

commit 3932095b6db7505e3d53b8c9aed47762875bad26
parent 95536d068145fabc6c31db5fbabe6b59a318e66e
Author: Marc Stibane <marc@taler.net>
Date:   Thu, 13 Nov 2025 22:20:25 +0100

cleanup

Diffstat:
MTalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift | 2+-
MTalerWallet1/Views/OIM/OIMEditView.swift | 3++-
MTalerWallet1/Views/OIM/OIMactionButtons.swift | 21+--------------------
MTalerWallet1/Views/OIM/OIMbackground.swift | 1+
MTalerWallet1/Views/OIM/OIMcurrencyDrawer.swift | 12++++++------
MTalerWallet1/Views/OIM/OIMpayView.swift | 2+-
MTalerWallet1/Views/OIM/OIMviews.swift | 9+++++----
MTalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift | 4++--
8 files changed, 19 insertions(+), 35 deletions(-)

diff --git a/TalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift b/TalerWallet1/Views/Actions/Peer2peer/SendAmountV.swift @@ -144,7 +144,7 @@ struct SendAmountV: View { #if OIM .overlay { if #available(iOS 16.4, *) { if controller.oimModeActive { -// let _ = print(">>> SendAmountV", amountAvailable, amountToTransfer, stack.peek()?.file) +// let _ = print(">>> SendAmountV", amountAvailable, amountToTransfer, stack.peek()?.file) let available = !amountAvailable.isZero ? amountAvailable : balance?.available ?? selectedBalance?.available ?? diff --git a/TalerWallet1/Views/OIM/OIMEditView.swift b/TalerWallet1/Views/OIM/OIMEditView.swift @@ -9,6 +9,7 @@ import SwiftUI import taler_swift // MARK: - +// called by SendAmountV @available(iOS 16.4, *) struct OIMEditView: View { let stack: CallStack @@ -98,7 +99,7 @@ struct OIMEditView: View { cash: cash, amountVal: $amountVal, canEdit: true) - .matchedGeometryEffect(id: "OIMline", in: wrapper.namespace, isSource: true) + .matchedGeometryEffect(id: OIMLINE, in: wrapper.namespace, isSource: true) .zIndex(1) // make notes fly from topZ .scaleEffect(sending ? 0.6 : 1.0) .onChange(of: amountVal) { newVal in diff --git a/TalerWallet1/Views/OIM/OIMactionButtons.swift b/TalerWallet1/Views/OIM/OIMactionButtons.swift @@ -26,7 +26,7 @@ struct OIMactionButton: View { var body: some View { let imageName = switch type { - case .sendP2P : "SendMoney" // "SendTaler" + case .sendP2P : "SendMoney" case .withdrawal: "Withdraw" case .deposit: "Deposit" case .requestP2P: "Request" @@ -44,25 +44,6 @@ struct OIMactionButton: View { } } -struct OIMrequestButton: View { - let enabled: Bool - let action: () -> Void - - var body: some View { - let imageName = "Request.png" // "SendTaler" - Button(action: action) { - Image(imageName) - .resizable() - .scaledToFit() -// .tint(WalletColors().talerColor) - .foregroundStyle(Color.accentColor) - } - .tagStyle(.bordered) - .opacity(enabled ? 1 : INVISIBLE) - .disabled(!enabled) - } -} - struct OIMbalanceButton: View { let isOpen: Bool let chest: String diff --git a/TalerWallet1/Views/OIM/OIMbackground.swift b/TalerWallet1/Views/OIM/OIMbackground.swift @@ -81,6 +81,7 @@ struct OIMamountV: View { } } // MARK: - +// shows a ZStack with backImage, and content on top struct OIMbackground<Content: View>: View { var content: () -> Content diff --git a/TalerWallet1/Views/OIM/OIMcurrencyDrawer.swift b/TalerWallet1/Views/OIM/OIMcurrencyDrawer.swift @@ -31,16 +31,16 @@ struct OIMcurrencyDrawer: View { ForEach(currency.bankNotes, id: \.self) { value in let sourceID = -Int(value) let fund = OIMfund(id: sourceID, - value: value, -// currencyIndex: cash.currencyIndex - currencyStr: currency.currencyStr) + value: value, +// currencyIndex: cash.currencyIndex + currencyStr: currency.currencyStr) OIMcurrencyButton(stack: stack.push(), fund: fund, currency: currency, availableVal: availableVal, canEdit: canEdit, isDrawer: true, - pct: 0.9, // hover a bit above the desk + pct: 0.8, // hover a bit above the desk action: { tappedVal = value } ) .id(currency.noteBase + String(sourceID)) @@ -49,7 +49,7 @@ struct OIMcurrencyDrawer: View { ForEach(currency.bankCoins, id: \.self) { value in let sourceID = -Int(value) let fund = OIMfund(id: sourceID, - value: value, + value: value, // currencyIndex: cash.currencyIndex currencyStr: currency.currencyStr) OIMcurrencyButton(stack: stack.push(), @@ -58,7 +58,7 @@ struct OIMcurrencyDrawer: View { availableVal: availableVal, canEdit: canEdit, isDrawer: true, - pct: 0.9, + pct: 0.8, action: { tappedVal = value } ) .id(currency.noteBase + String(sourceID)) diff --git a/TalerWallet1/Views/OIM/OIMpayView.swift b/TalerWallet1/Views/OIM/OIMpayView.swift @@ -31,7 +31,7 @@ struct OIMpayView: View { cash: cash, amountVal: $amountVal, canEdit: true) - .matchedGeometryEffect(id: "OIMline", in: wrapper.namespace, isSource: true) + .matchedGeometryEffect(id: OIMLINE, in: wrapper.namespace, isSource: true) Spacer() } #if DEBUG diff --git a/TalerWallet1/Views/OIM/OIMviews.swift b/TalerWallet1/Views/OIM/OIMviews.swift @@ -13,10 +13,11 @@ let OIMactionSize = 120.0 let OIMACTION = "OIMaction" // Position: trailing edge of the title row let OIMACTION2 = "OIMaction2" // currently unused -let OIMNUMBER = "OIMnumber" -let OIMCHEST = "OIMchest" -let OIMBACK = "OIMback" -let OIMSIDE = "OIMside" +let OIMNUMBER = "OIMnumber" // center-top +let OIMCHEST = "OIMchest" // middle +let OIMBACK = "OIMback" // Back Button, QR +let OIMLINE = "OIMline" // unused, middle, OIMlineView +let OIMSIDE = "OIMside" // trailing-center, money (history) // MARK: - struct OIMnavBack<Content: View>: View { diff --git a/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift b/TalerWallet1/Views/Sheets/WithdrawBankIntegrated/WithdrawTOSView.swift @@ -16,7 +16,7 @@ struct WithdrawTOSView: View { let viewID: Int // either VIEW_WITHDRAW_TOS or SHEET_WITHDRAW_TOS let acceptAction: (() async -> Void)? - @Environment(\.presentationMode) var presentationMode + @Environment(\.dismiss) var dismiss // pop back once @EnvironmentObject private var model: WalletModel @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic @@ -45,7 +45,7 @@ struct WithdrawTOSView: View { if acceptAction != nil { await acceptAction!() } else { // just go back - caller will reload - self.presentationMode.wrappedValue.dismiss() + dismiss() } } else { // TODO: error