commit 1c82fd8df21f2f451b5beca8531ef478b4580dc7
parent 2b03376a5f28335954374e748bc59f2add6146a0
Author: Marc Stibane <marc@taler.net>
Date: Mon, 28 Sep 2026 22:08:29 +0200
SelectedBackground
Diffstat:
1 file changed, 12 insertions(+), 9 deletions(-)
diff --git a/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift b/TalerWallet1/Views/Sheets/Payment/ChoicesView.swift
@@ -8,15 +8,10 @@
import SwiftUI
import taler_swift
-struct ChoicesView: View, Sendable {
- let stack: CallStack
- let choiceTriple: [ChoiceTriple]
- let showHeader: Bool
- let automaticIndex: Int?
- @Binding var selectedChoice: Int?
+struct SelectedBackground: View, Sendable {
+ let useColor: Bool
- @ViewBuilder
- func selectedBackground(_ useColor: Bool) -> some View {
+ var body: some View {
let is26: Bool = if #available(iOS 26.0, *) { true } else { false }
let color: Color = useColor ? WalletColors().primaryAccent
: .secondary
@@ -30,6 +25,14 @@ struct ChoicesView: View, Sendable {
.foregroundColor(Color.clear)
}
}
+}
+
+struct ChoicesView: View, Sendable {
+ let stack: CallStack
+ let choiceTriple: [ChoiceTriple]
+ let showHeader: Bool
+ let automaticIndex: Int?
+ @Binding var selectedChoice: Int?
var body: some View {
ForEach(choiceTriple, id: \.1) { choice in
@@ -62,7 +65,7 @@ struct ChoicesView: View, Sendable {
}
if index == selectedChoice {
amountV.listRowBackground (
- selectedBackground(isPaymentPossible)
+ SelectedBackground(useColor: isPaymentPossible)
// .padding(.top, n == 1 ? 0 : -15)
// .padding(.bottom, n == 10 ? 0 : -15)
)