gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 135/204: Colors


From: gnunet
Subject: [taler-taler-ios] 135/204: Colors
Date: Thu, 05 Dec 2024 23:51:43 +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 e17561c6b2839de6adc6e8cd7179a15c6997d556
Author: Marc Stibane <marc@taler.net>
AuthorDate: Mon Nov 18 16:03:58 2024 +0100

    Colors
---
 TalerWallet1/Helper/WalletColors.swift                     | 7 +++++++
 TalerWallet1/Views/Actions/Banking/QuiteSomeCoins.swift    | 2 +-
 TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift     | 2 +-
 TalerWallet1/Views/HelperViews/AmountV.swift               | 2 +-
 TalerWallet1/Views/HelperViews/BarGraph.swift              | 2 +-
 TalerWallet1/Views/HelperViews/Buttons.swift               | 4 ++--
 TalerWallet1/Views/HelperViews/IconBadge.swift             | 4 ++--
 TalerWallet1/Views/HelperViews/SubjectInputV.swift         | 2 +-
 TalerWallet1/Views/Sheets/ErrorSheet.swift                 | 2 +-
 TalerWallet1/Views/Transactions/TransactionRowView.swift   | 2 +-
 TalerWallet1/Views/Transactions/TransactionsListView.swift | 2 +-
 11 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/TalerWallet1/Helper/WalletColors.swift 
b/TalerWallet1/Helper/WalletColors.swift
index 4871978..830169f 100644
--- a/TalerWallet1/Helper/WalletColors.swift
+++ b/TalerWallet1/Helper/WalletColors.swift
@@ -21,6 +21,13 @@ public struct WalletColors {
     let gray8 = grouped ? Color(.secondarySystemGroupedBackground)
                         : Color(.secondarySystemBackground)       // disabled 
Back
 
+    let attention = Color.red
+    let confirm = Color.yellow
+
+    // TODO: In Japan, negative is blue, and positive is red
+    let positive = Color.green
+    let negative = Color.red
+
     func buttonForeColor(pressed: Bool, disabled: Bool,
                        prominent: Bool = false, balance: Bool = false) -> 
Color {
              balance ? Color.primary
diff --git a/TalerWallet1/Views/Actions/Banking/QuiteSomeCoins.swift 
b/TalerWallet1/Views/Actions/Banking/QuiteSomeCoins.swift
index 5010b70..5f60c1b 100644
--- a/TalerWallet1/Views/Actions/Banking/QuiteSomeCoins.swift
+++ b/TalerWallet1/Views/Actions/Banking/QuiteSomeCoins.swift
@@ -83,7 +83,7 @@ struct QuiteSomeCoins: View {
             Text(coinData.tooMany ? "Amount too big for a single withdrawal!"
              : coinData.quiteSome ? "Note: It will take quite some time to 
prepare this amount! Be more patient..."
                                   : "Note: It will take some time to prepare 
this amount. Be patient...")
-                .foregroundColor(isError || coinData.quiteSome ? .red : 
.primary)
+                .foregroundColor(isError || coinData.quiteSome ? 
WalletColors().attention : .primary)
                 .talerFont(.body)
                 .multilineTextAlignment(.leading)
                 .padding(.vertical, 6)
diff --git a/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift 
b/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
index fd15c05..939773c 100644
--- a/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
+++ b/TalerWallet1/Views/Actions/Peer2peer/P2PSubjectV.swift
@@ -82,7 +82,7 @@ struct P2PSubjectV: View {
                 if label.count > 0 {
                     Text(label)
                         .frame(maxWidth: .infinity, alignment: .trailing)
-                        .foregroundColor(feeIsNotZero ? .red : 
WalletColors().secondary(colorScheme, colorSchemeContrast))
+                        .foregroundColor(WalletColors().secondary(colorScheme, 
colorSchemeContrast))
                         .talerFont(.body)
                 }
             }
diff --git a/TalerWallet1/Views/HelperViews/AmountV.swift 
b/TalerWallet1/Views/HelperViews/AmountV.swift
index 139e057..eaceca7 100644
--- a/TalerWallet1/Views/HelperViews/AmountV.swift
+++ b/TalerWallet1/Views/HelperViews/AmountV.swift
@@ -53,7 +53,7 @@ struct AmountV: View {
 
     var body: some View {
         Text(amountStr(currencyInfo))
-            .strikethrough(strikethrough, color: .red)
+            .strikethrough(strikethrough, color: WalletColors().attention)
             .multilineTextAlignment(.center)
             .talerFont(large ? .title : .title2)
 //            .fontWeight(large ? .medium : .regular)       // @available(iOS 
16.0, *)
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift 
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index ed22ebd..57d6dc5 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -91,7 +91,7 @@ struct BarGraph: View {
                                 .frame(width: width, height: topHeight)
                         }
                         Rectangle()
-                            .foregroundColor(incoming ? .green : .red)
+                            .foregroundColor(incoming ? 
WalletColors().positive : WalletColors().negative)
                             .frame(width: width, height: valueColored)
                         if botHeight > 0 {
                             Rectangle()
diff --git a/TalerWallet1/Views/HelperViews/Buttons.swift 
b/TalerWallet1/Views/HelperViews/Buttons.swift
index 5c4080c..34c696d 100644
--- a/TalerWallet1/Views/HelperViews/Buttons.swift
+++ b/TalerWallet1/Views/HelperViews/Buttons.swift
@@ -284,8 +284,8 @@ struct TalerButtonStyle: ButtonStyle {
                                 .animation(.spring(response: 0.1), value: 
configuration.isPressed)
                                 .disabled(disabled)
             if hasBadge {
-                let badgeColor: Color = (badge == CONFIRM_BANK) ? .yellow
-                                                                : .red
+                let badgeColor: Color = (badge == CONFIRM_BANK) ? 
WalletColors().confirm
+                                                                : 
WalletColors().attention
                 let badgeV = Image(systemName: badge)
                                 .talerFont(.caption)
                 HStack(alignment: .top, spacing: 0) {
diff --git a/TalerWallet1/Views/HelperViews/IconBadge.swift 
b/TalerWallet1/Views/HelperViews/IconBadge.swift
index c258956..bdd4cd2 100644
--- a/TalerWallet1/Views/HelperViews/IconBadge.swift
+++ b/TalerWallet1/Views/HelperViews/IconBadge.swift
@@ -88,8 +88,8 @@ struct IconBadge: View {
                                          : CONFIRM_BANK
                 Image(systemName: badgeName)
                     .talerFont(.caption)
-                    .foregroundColor(needsKYC ? .red
-                              : shouldConfirm ? .yellow
+                    .foregroundColor(needsKYC ? WalletColors().attention
+                              : shouldConfirm ? WalletColors().confirm
                                               : .clear)
             }
         }.accessibilityHidden(true)
diff --git a/TalerWallet1/Views/HelperViews/SubjectInputV.swift 
b/TalerWallet1/Views/HelperViews/SubjectInputV.swift
index 56e4a4f..c5c306a 100644
--- a/TalerWallet1/Views/HelperViews/SubjectInputV.swift
+++ b/TalerWallet1/Views/HelperViews/SubjectInputV.swift
@@ -95,7 +95,7 @@ struct SubjectInputV<TargetView: View>: View {
 //            if insufficient {
 //                Text(insufficientLabel)
 //                    .talerFont(.body)
-//                    .foregroundColor(.red)
+//                    .foregroundColor(WalletColors().attention)
 //                    .padding(4)
 //            }
 
diff --git a/TalerWallet1/Views/Sheets/ErrorSheet.swift 
b/TalerWallet1/Views/Sheets/ErrorSheet.swift
index 49ecdff..2d68ea6 100644
--- a/TalerWallet1/Views/Sheets/ErrorSheet.swift
+++ b/TalerWallet1/Views/Sheets/ErrorSheet.swift
@@ -81,7 +81,7 @@ struct ErrorSheet: View {
                     .resizable()
                     .frame(width: 50, height: 50)
                     .aspectRatio(contentMode: .fit)
-                    .foregroundStyle(.red)
+                    .foregroundStyle(WalletColors().attention)
                     .padding()
 
                 Text(title)
diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift 
b/TalerWallet1/Views/Transactions/TransactionRowView.swift
index d1c4dc1..621825e 100644
--- a/TalerWallet1/Views/Transactions/TransactionRowView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionRowView.swift
@@ -80,7 +80,7 @@ struct TransactionRowView: View {
         let topString = topString()
         let centerTop = Text(topString ?? EMPTYSTRING)
             .foregroundColor(textColor)
-            .strikethrough(!doneOrPending, color: .red)
+            .strikethrough(!doneOrPending, color: WalletColors().negative)
             .talerFont(.headline)
 //            .fontWeight(.medium)      iOS 16
             .padding(.bottom, -2.0)
diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift 
b/TalerWallet1/Views/Transactions/TransactionsListView.swift
index 61f1f7c..09b8cb3 100644
--- a/TalerWallet1/Views/Transactions/TransactionsListView.swift
+++ b/TalerWallet1/Views/Transactions/TransactionsListView.swift
@@ -136,7 +136,7 @@ struct TransactionsArraySliceV: View {
                         } label: {
                             Label("Delete", systemImage: "trash")
                         }
-                        .tint(.red)
+                        .tint(WalletColors().negative)
                     }
             } else {
                 row

-- 
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]