gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 147/204: layout improvement


From: gnunet
Subject: [taler-taler-ios] 147/204: layout improvement
Date: Thu, 05 Dec 2024 23:51:55 +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 e4c14f0c95d0eb7ef958c9c8a5b22035cd15acf7
Author: Marc Stibane <marc@taler.net>
AuthorDate: Wed Nov 20 07:50:32 2024 +0100

    layout improvement
---
 TalerWallet1/Views/HelperViews/ScopePicker.swift | 42 ++++++++++++++----------
 1 file changed, 25 insertions(+), 17 deletions(-)

diff --git a/TalerWallet1/Views/HelperViews/ScopePicker.swift 
b/TalerWallet1/Views/HelperViews/ScopePicker.swift
index 9e8fcfb..d4d529c 100644
--- a/TalerWallet1/Views/HelperViews/ScopePicker.swift
+++ b/TalerWallet1/Views/HelperViews/ScopePicker.swift
@@ -44,7 +44,7 @@ struct ScopePicker: View {
             let url = balance.scopeInfo.url?.trimURL ?? EMPTYSTRING
             let a11yLabel = url + ", " + availableA11y
 
-            HStack(alignment: .top) {
+            HStack(alignment: .firstTextBaseline) {
                 let disabled = (count == 1)
                 Text("via", comment: "ScopePicker")
                     .accessibilityHidden(true)
@@ -104,23 +104,29 @@ struct  ScopeDropDown: View {
     }
 
     @ViewBuilder
-    func dropDownRow(_ balance: Balance, _ currencyInfo: CurrencyInfo) -> some 
View {
-        let hLayout = HStack(alignment: .top) {
-            Text(urlOrCurrency(balance))
-            Spacer()
-            Text(formattedAmount(balance, currencyInfo).nbs)
-        }
-        let vLayout = VStack(alignment: .leading) {
-            Text(urlOrCurrency(balance))
-            HStack {
-                Spacer()
-                Text(formattedAmount(balance, currencyInfo).nbs)
+    func dropDownRow(_ balance: Balance, _ currencyInfo: CurrencyInfo, _ 
first: Bool = false) -> some View {
+        let text = Text(urlOrCurrency(balance))
+        let amount = Text(formattedAmount(balance, currencyInfo).nbs)
+        if first {
+            text
+        } else {
+            let hLayout = HStack(alignment: .firstTextBaseline) {
+                text
                 Spacer()
+                amount
+            }.padding(.vertical, 4)
+            let vLayout = VStack(alignment: .leading) {
+                text
+                HStack {
+                    Spacer()
+                    amount
+                    Spacer()
+                }
+            }
+            ViewThatFits(in: .horizontal) {
+                hLayout
+                vLayout
             }
-        }
-        ViewThatFits(in: .horizontal) {
-            hLayout
-            vLayout
         }
     }
 
@@ -159,9 +165,10 @@ struct  ScopeDropDown: View {
                 // selected item
                 let balance = controller.balances[selection]
                 let currencyInfo = controller.info(for: balance.scopeInfo, 
controller.currencyTicker)
+                let noAmount = !showDropdown
                 Button(action: buttonAction) {
                     HStack(alignment: .firstTextBaseline) {
-                        dropDownRow(balance, currencyInfo)
+                        dropDownRow(balance, currencyInfo, noAmount)
                             .accessibilityAddTraits(.isSelected)
                         Spacer()
                         if !disabled {
@@ -170,6 +177,7 @@ struct  ScopeDropDown: View {
                         }
                     }
                 }
+                    .padding(.vertical, 4)
                     .padding(.horizontal, radius / 2)
                     .frame(maxWidth: .infinity, alignment: .leading)
 //                .border(.red)

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