gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[taler-taler-ios] 24/25: Accessibility: Contrast


From: gnunet
Subject: [taler-taler-ios] 24/25: Accessibility: Contrast
Date: Mon, 06 Nov 2023 20:40:31 +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 d9f33be08939c82a56f51cb3a2ec43d82f3f9633
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Nov 6 20:25:34 2023 +0100

    Accessibility: Contrast
---
 TalerWallet1/Views/Balances/BalanceRowView.swift            | 5 ++++-
 TalerWallet1/Views/Balances/BalancesSectionView.swift       | 2 ++
 TalerWallet1/Views/HelperViews/AmountRowV.swift             | 8 +++++++-
 TalerWallet1/Views/HelperViews/BarGraph.swift               | 2 ++
 TalerWallet1/Views/Settings/SettingsView.swift              | 3 +++
 TalerWallet1/Views/Transactions/TransactionDetailView.swift | 5 ++++-
 6 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift 
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index a9b4b3a..2fb15ae 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -11,6 +11,8 @@ struct BalanceButton: View {
     let rowAction: () -> Void
 
     @AppStorage("iconOnly") var iconOnly: Bool = false
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
 
     var body: some View {
         let balanceTitleStr = String(localized: "Balance:", comment: "Main 
view")
@@ -27,7 +29,8 @@ struct BalanceButton: View {
                                fitsHorizontal: fitsSideBySide, vertAlignment: 
.lastTextBaseline) {
                         Text(title)
                             .accessibilityFont(.title2)
-                            .foregroundColor(.secondary)
+                            .foregroundColor(colorSchemeContrast == .increased 
? .primary : .secondary)
+//                            .foregroundColor(moreContrast ? .primary : 
.secondary)
                     }
                 }
             }
diff --git a/TalerWallet1/Views/Balances/BalancesSectionView.swift 
b/TalerWallet1/Views/Balances/BalancesSectionView.swift
index 7acdb48..d0a3718 100644
--- a/TalerWallet1/Views/Balances/BalancesSectionView.swift
+++ b/TalerWallet1/Views/Balances/BalancesSectionView.swift
@@ -22,6 +22,7 @@ struct BalancesSectionView {
     @Binding var centsToTransfer: UInt64
     @Binding var summary: String
 
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
     @AppStorage("iconOnly") var iconOnly: Bool = false
     @EnvironmentObject private var model: WalletModel
     @EnvironmentObject private var controller: Controller
@@ -143,6 +144,7 @@ extension BalancesSectionView: View {
                 if !iconOnly {
                     Text("Recent transactions")
                         .accessibilityFont(.callout)
+//                        .foregroundColor(moreContrast ? .primary : 
.secondary)
                 }
             }
         }
diff --git a/TalerWallet1/Views/HelperViews/AmountRowV.swift 
b/TalerWallet1/Views/HelperViews/AmountRowV.swift
index 59b7c10..ac741f9 100644
--- a/TalerWallet1/Views/HelperViews/AmountRowV.swift
+++ b/TalerWallet1/Views/HelperViews/AmountRowV.swift
@@ -49,6 +49,8 @@ struct AmountRowV<Content: View>: View {
 
 struct SectionWithAmountRow: View {
     @Environment(\.sizeCategory) var sizeCategory
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
+
     var body: some View {
         let testInfo = PreviewCurrencyInfo(TESTCURRENCY, digits: 0)
         let demoInfo = PreviewCurrencyInfo(DEMOCURRENCY, digits: 2)
@@ -61,23 +63,27 @@ struct SectionWithAmountRow: View {
                 AmountRowV(amountStr: demoStr, amountColor: .primary, 
largeAmountFont: true,
                            fitsHorizontal: true, vertAlignment: 
.lastTextBaseline) {
                     Text(verbatim: "Balance")
+                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
                         .accessibilityFont(.title2)
                 }
                 AmountRowV(amountStr: demoStr, amountColor: .primary, 
largeAmountFont: true,
                            fitsHorizontal: false, vertAlignment: 
.lastTextBaseline) {
                     Text(verbatim: "Balance")
+                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
                         .accessibilityFont(.title2)
                 }
             }
             Section {
-                AmountRowV(amountStr: testStr, amountColor: .secondary, 
largeAmountFont: false,
+                AmountRowV(amountStr: testStr, amountColor: .primary, 
largeAmountFont: false,
                            fitsHorizontal: true, vertAlignment: 
.lastTextBaseline) {
                     Text(verbatim: "Balance")
+                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
                         .accessibilityFont(.title2)
                 }
                 AmountRowV(amountStr: testStr, amountColor: .secondary, 
largeAmountFont: false,
                            fitsHorizontal: false, vertAlignment: 
.lastTextBaseline) {
                     Text(verbatim: "Balance")
+                        .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
                         .accessibilityFont(.title2)
                 }
             }
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift 
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index dd66634..9eb61dc 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -12,6 +12,7 @@ struct BarGraphHeader: View {
     let stack: CallStack
     let currency: String
 
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
     @EnvironmentObject private var model: WalletModel
     @State private var completedTransactions: [Transaction] = []
 
@@ -19,6 +20,7 @@ struct BarGraphHeader: View {
         HStack (alignment: .center, spacing: 10) {
             Text(currency)
                 .accessibilityFont(.title2)
+//                .foregroundColor(moreContrast ? .primary : .secondary)
             BarGraph(transactions: $completedTransactions,
                      maxBars: MAXBARS, barHeight: 10)       // TODO: barHeight 
relative to fontSize
         }
diff --git a/TalerWallet1/Views/Settings/SettingsView.swift 
b/TalerWallet1/Views/Settings/SettingsView.swift
index 17d0186..40abcc2 100644
--- a/TalerWallet1/Views/Settings/SettingsView.swift
+++ b/TalerWallet1/Views/Settings/SettingsView.swift
@@ -28,6 +28,7 @@ struct SettingsView: View {
 #else
     @AppStorage("developerMode") var developerMode: Bool = false
 #endif
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
     @AppStorage("useHaptics") var useHaptics: Bool = true
     @AppStorage("playSounds") var playSounds: Int = 1
     @AppStorage("talerFont") var talerFont: Int = 0
@@ -101,6 +102,8 @@ struct SettingsView: View {
                     SettingsItem(name: aboutStr, id1: "about",
                           description: hideDescriptions ? nil : 
String(localized: "More info about this app...")) {}
                 }
+//                SettingsToggle(name: String(localized: "More Contrast"), 
value: $moreContrast, id1: "contrast",
+//                               description: hideDescriptions ? nil : 
String(localized: "If you don't like grey"))
                 if controller.hapticCapability.supportsHaptics {
                     SettingsToggle(name: String(localized: "Haptics"), value: 
$useHaptics, id1: "haptics",
                             description: hideDescriptions ? nil : 
String(localized: "Vibration Feedback"))
diff --git a/TalerWallet1/Views/Transactions/TransactionDetailView.swift 
b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
index bae70f2..aca9ae8 100644
--- a/TalerWallet1/Views/Transactions/TransactionDetailView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionDetailView.swift
@@ -25,11 +25,13 @@ struct TransactionDetailView: View {
     private let symLog = SymLogV(0)
     let stack: CallStack
     @AppStorage("myListStyle") var myListStyle: MyListStyle = .automatic
+//    @AppStorage("moreContrast") var moreContrast: Bool = false
 #if DEBUG
     @AppStorage("developerMode") var developerMode: Bool = true
 #else
     @AppStorage("developerMode") var developerMode: Bool = false
 #endif
+    @Environment(\.colorSchemeContrast) private var colorSchemeContrast
 
     let transactionId: String
     let reloadAction: ((_ transactionId: String) async throws -> Transaction)
@@ -80,7 +82,8 @@ struct TransactionDetailView: View {
                 Text(dateString)
                     .accessibilityFont(.body)
                     .accessibilityLabel(accessibilityDate)
-                    .foregroundColor(.secondary)
+                    .foregroundColor(colorSchemeContrast == .increased ? 
.primary : .secondary)
+//                    .foregroundColor(moreContrast ? .primary : .secondary)
                     .listRowSeparator(.hidden)
                 HStack {
                     Text(verbatim: "|")   // only reason for this 
leading-aligned text is to get a nice full length listRowSeparator

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]