taler-ios

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

commit 2f43f4269cbc47a00c503f02f6c7f75bb2920d8f
parent fbf878e49ff96b939322323b1fd6b3200c714f69
Author: Marc Stibane <marc@taler.net>
Date:   Sat, 18 Nov 2023 19:29:33 +0100

accessibilityAddTraits

Diffstat:
MTalerWallet1/Views/HelperViews/SelectDays.swift | 8+++-----
1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/SelectDays.swift b/TalerWallet1/Views/HelperViews/SelectDays.swift @@ -34,8 +34,6 @@ struct SelectDays: View { } var body: some View { - let selectedStr = String(localized: "selected", comment: "VoiceOver hint which button is selected") - Section { // (alignment: .leading) Text("Expires in:") .accessibilityLabel("Choose the expiration duration") @@ -50,7 +48,7 @@ struct SelectDays: View { Text("\(ONEDAY) Day", comment: "1 Day, might get plural (e.g. 2..3 Days), 4 letters max., abbreviate if longer") // TODO: Plural } }.buttonStyle(TalerButtonStyle(type: (selected == ONEDAY) ? .prominent : .bordered, dimmed: true)) - .accessibilityValue((selected == ONEDAY) ? selectedStr : EMPTYSTRING) + .accessibilityAddTraits(selected == ONEDAY ? .isSelected : []) .disabled(!isEnabled) Button(action: sevenDayAction) { @@ -60,7 +58,7 @@ struct SelectDays: View { Text("\(SEVENDAYS) Days", comment: "7 Days, always plural (3..9), 4 letters max., abbreviate if longer") } }.buttonStyle(TalerButtonStyle(type: (selected == SEVENDAYS) ? .prominent : .bordered, dimmed: true)) - .accessibilityValue((selected == SEVENDAYS) ? selectedStr : EMPTYSTRING) + .accessibilityAddTraits(selected == SEVENDAYS ? .isSelected : []) .disabled(!isEnabled || maxExpiration < SEVENDAYS) Button(action: thirtyDayAction) { @@ -70,7 +68,7 @@ struct SelectDays: View { Text("\(THIRTYDAYS) Days", comment: "30 Days, always plural (10..30), 4 letters max., abbreviate if longer") } }.buttonStyle(TalerButtonStyle(type: (selected == THIRTYDAYS) ? .prominent : .bordered, dimmed: true)) - .accessibilityValue((selected == THIRTYDAYS) ? selectedStr : EMPTYSTRING) + .accessibilityAddTraits(selected == THIRTYDAYS ? .isSelected : []) .disabled(!isEnabled || maxExpiration < THIRTYDAYS) } // 3 buttons }