gnunet-svn
[Top][All Lists]
Advanced

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

[taler-taler-ios] 34/54: sizeCategory, task


From: gnunet
Subject: [taler-taler-ios] 34/54: sizeCategory, task
Date: Fri, 30 Jun 2023 22:34:06 +0200

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 d62d3f01d3d4712f8536a3fe1c80553b9d383c54
Author: Marc Stibane <marc@taler.net>
AuthorDate: Tue Jun 27 22:34:39 2023 +0200

    sizeCategory, task
---
 TalerWallet1/Views/Balances/BalanceRowView.swift | 34 +++++++++++++++++-------
 TalerWallet1/Views/Main/MainView.swift           |  5 ++++
 2 files changed, 30 insertions(+), 9 deletions(-)

diff --git a/TalerWallet1/Views/Balances/BalanceRowView.swift 
b/TalerWallet1/Views/Balances/BalanceRowView.swift
index 84a6386..940ca35 100644
--- a/TalerWallet1/Views/Balances/BalanceRowView.swift
+++ b/TalerWallet1/Views/Balances/BalanceRowView.swift
@@ -13,17 +13,34 @@ struct BalanceRowView: View {
     let sendAction: () -> Void
     let recvAction: () -> Void
     let rowAction: () -> Void
+    @Environment(\.sizeCategory) var sizeCategory
+
     var body: some View {
         let currency = amount.currencyStr
         HStack {
-            Button("Request\nPayment", action: recvAction)
-                .lineLimit(2)
-                .disabled(false)
-                .buttonStyle(TalerButtonStyle(type: .bordered, narrow: true, 
aligned: .leading))
-            Button("Send\n\(currency)", action: sendAction)
-                .lineLimit(2)
-                .disabled(amount.isZero)
-                .buttonStyle(TalerButtonStyle(type: .bordered, narrow: true, 
aligned: .leading))
+            if sizeCategory > ContentSizeCategory.large {
+                VStack {
+                    Button("Request\nPayment", action: recvAction)
+                        .disabled(false)
+                        .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
false, aligned: .leading))
+                    Button("Send\n\(currency)", action: sendAction)
+                        .disabled(amount.isZero)
+                        .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
false, aligned: .leading))
+                }
+                .fixedSize(horizontal: true, vertical: false)   // make the 
buttons equal width
+            } else {
+                HStack {
+                    Button("Request\nPayment", action: recvAction)
+                        .lineLimit(2)
+                        .disabled(false)
+                        .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
true, aligned: .leading))
+                    Button("Send\n\(currency)", action: sendAction)
+                        .lineLimit(2)
+                        .disabled(amount.isZero)
+                        .buttonStyle(TalerButtonStyle(type: .bordered, narrow: 
true, aligned: .leading))
+                }
+                .fixedSize(horizontal: true, vertical: true)   // should make 
all buttons equal height - but doesn't
+            }
             Button(action: rowAction) {
                 VStack(alignment: .trailing, spacing: 0) {
                     HStack(alignment: .firstTextBaseline, spacing: 0) {
@@ -41,7 +58,6 @@ struct BalanceRowView: View {
                 .buttonStyle(TalerButtonStyle(type: .plain, aligned: 
.trailing))
 //                .background(Color.yellow)
         }
-        .fixedSize(horizontal: false, vertical: true)   // should make all 
buttons equal height - but doesn't
         .accessibilityElement(children: .combine)
     }
 }
diff --git a/TalerWallet1/Views/Main/MainView.swift 
b/TalerWallet1/Views/Main/MainView.swift
index 3c30967..cc96f62 100644
--- a/TalerWallet1/Views/Main/MainView.swift
+++ b/TalerWallet1/Views/Main/MainView.swift
@@ -51,6 +51,11 @@ struct MainView: View {
                 ErrorView(errortext: nil)            // TODO: show Error View
             } else {
                 LaunchAnimationView()
+                    .task {
+                        let deviceW = UIScreen.main.bounds.width
+                        let deviceH = UIScreen.main.bounds.height
+                        print(deviceW, deviceH)
+                    }
             }
         }
         .animation(.easeOut(duration: LAUNCHDURATION), value: 
controller.backendState)

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