taler-ios

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

commit f3fc3e40f58ecbd4bcd16982e8628552df6aa45c
parent 837c0dc03a095a60909ce8651e27a888f7d6513a
Author: Marc Stibane <marc@taler.net>
Date:   Mon,  8 Jun 2026 16:52:36 +0200

Show view sizes

Diffstat:
MTalerWallet1/Controllers/DebugViewC.swift | 31+++++++++++++++++--------------
MTalerWallet1/Views/HelperViews/DebugSpacer.swift | 5++---
MTalerWallet1/Views/Settings/DebugSettingsView.swift | 6+++++-
MTalerWallet1/Views/Transactions/TransactionRowView.swift | 11++++++-----
MTalerWallet1/Views/Transactions/TransactionsListView.swift | 4+++-
5 files changed, 33 insertions(+), 24 deletions(-)

diff --git a/TalerWallet1/Controllers/DebugViewC.swift b/TalerWallet1/Controllers/DebugViewC.swift @@ -27,20 +27,14 @@ import os.log // MARK: - Main View public let VIEW_EMPTY_WALLET = 10 // 10 WalletEmptyView public let VIEW_BALANCES = VIEW_EMPTY_WALLET + 1 // 11 BalancesListView -public let VIEW_SETTINGS = VIEW_BALANCES + 1 // 12 SettingsView -public let VIEW_ABOUT = VIEW_SETTINGS + 1 // 13 AboutView -public let VIEW_PAYMENT_SERVICES = VIEW_ABOUT + 1 // 14 ExchangeListView -public let VIEW_BANK_ACCOUNTS = VIEW_PAYMENT_SERVICES + 1 // 15 BankListView -public let VIEW_BACKUP = VIEW_BANK_ACCOUNTS + 1 // 16 BackupView -public let VIEW_CAROUSEL = VIEW_BACKUP + 1 // 17 CarouselView - -// MARK: Transactions +public let VIEW_CAROUSEL = VIEW_BALANCES + 1 // 12 CarouselView + +// MARK: - Transactions public let VIEW_EMPTY_HISTORY = VIEW_EMPTY_WALLET + 10 // 20 TransactionsEmptyView public let VIEW_TRANSACTIONLIST = VIEW_EMPTY_HISTORY + 1 // 21 TransactionsListView public let VIEW_TRANSACTIONSUMMARY = VIEW_TRANSACTIONLIST + 1 // 22 TransactionSummary public let VIEW_TRANSACTIONDETAIL = VIEW_TRANSACTIONSUMMARY + 1 // 23 TransactionDetail - // MARK: - (Manual) Withdrawal (from Actions) // receive coins from bank ==> shows payee, IBAN + Purpose/Subject for manual wire transfer public let VIEW_WITHDRAWAL = VIEW_EMPTY_HISTORY + 10 // 30 WithdrawAmount @@ -67,11 +61,20 @@ public let VIEW_P2P_READY = VIEW_P2P_SUBJECT + 1 // 53 Send / public let VIEW_P2P_REQUEST = VIEW_P2P_SEND + 10 // 60 Request Amount public let VIEW_P2P_TOS = VIEW_P2P_REQUEST + 1 // 61 Request ToS -// MARK: Business Invoice (from Actions) +// MARK: - Settings +public let VIEW_SETTINGS = VIEW_P2P_REQUEST + 10 // 70 SettingsView +public let VIEW_ABOUT = VIEW_SETTINGS + 1 // 71 AboutView +public let VIEW_PAYMENT_SERVICES = VIEW_ABOUT + 1 // 72 ExchangeListView +public let VIEW_BANK_ACCOUNTS = VIEW_PAYMENT_SERVICES + 1 // 73 BankListView +public let VIEW_BACKUP = VIEW_BANK_ACCOUNTS + 1 // 74 BackupView +public let VIEW_SETTINGS2 = VIEW_BACKUP + 1 // 75 MoreSettingsView +public let VIEW_SETTINGS3 = VIEW_SETTINGS2 + 1 // 76 DebugSettingsView + +// MARK: - Business Invoice (from Actions) // TBD -//public let VIEW_INVOICE_P2P = VIEW_REQUEST_P2P + 10 // 70 Invoice Amount -//public let VIEW_INVOICE_TOS = VIEW_INVOICE_P2P + 1 // 71 Invoice ToS -//public let VIEW_INVOICE_PURPOSE = VIEW_INVOICE_TOS + 1 // 72 Invoice Purpose +//public let VIEW_INVOICE_P2P = VIEW_SETTINGS + 10 // 80 Invoice Amount +//public let VIEW_INVOICE_TOS = VIEW_INVOICE_P2P + 1 // 81 Invoice ToS +//public let VIEW_INVOICE_PURPOSE = VIEW_INVOICE_TOS + 1 // 82 Invoice Purpose // MARK: - Bank-Integrated Withdrawal @@ -128,7 +131,7 @@ struct DebugViewV: View { HStack { Spacer() viewIDv - .padding(.trailing, 50) + .padding(.trailing, UIScreen.hasNotch ? 50 : 60) // need more space for touchID phones } .accessibilityHidden(true) .ignoresSafeArea(edges: .top) diff --git a/TalerWallet1/Views/HelperViews/DebugSpacer.swift b/TalerWallet1/Views/HelperViews/DebugSpacer.swift @@ -10,6 +10,7 @@ import SwiftUI #if TALER_NIGHTLY struct Spacer: View { @AppStorage("developerMode") var developerMode: Bool = false + @AppStorage("debugViews") var debugViews: Bool = false let minLength: CGFloat? init(minLength: CGFloat? = nil) { @@ -18,7 +19,7 @@ struct Spacer: View { var body: some View { let spacer = SwiftUI.Spacer(minLength: minLength) - if developerMode { + if developerMode && debugViews { spacer.background { GeometryReader { geometry in let isVertical = geometry.size.height > geometry.size.width @@ -27,8 +28,6 @@ struct Spacer: View { .frame( width: isVertical ? 12 : nil, height: isVertical ? nil : 12 -// maxWidth: isVertical ? 12 : .infinity, -// maxHeight: isVertical ? .infinity : 12 ) } } diff --git a/TalerWallet1/Views/Settings/DebugSettingsView.swift b/TalerWallet1/Views/Settings/DebugSettingsView.swift @@ -30,6 +30,7 @@ struct DebugSettingsView: View { @AppStorage("minimalistic") var minimalistic: Bool = false @AppStorage("localConsoleL") var localConsoleL: Bool = false // for Logs @AppStorage("localConsoleO") var localConsoleO: Int = 0 // for Observability + @AppStorage("debugViews") var debugViews: Bool = false @State private var checkDisabled = false @State private var withDrawDisabled = false @@ -94,6 +95,9 @@ struct DebugSettingsView: View { consoleManager.isVisible = localConsoleO != 0 || localConsoleL consoleManager.clear() } + SettingsToggle(name: String(localized: "Show view sizes"), value: $debugViews, + id1: "debugViews", + description: String(localized: "Debug view layout and flickering")) #if DEBUG let banks = ["glstest.taler.net", "taler.fdold.eu", "regio-taler.fdold.eu", "taler.grothoff.org", "taler.ar", @@ -266,7 +270,7 @@ struct DebugSettingsView: View { .navigationTitle(navTitle) .onAppear() { showDevelopItems = developerMode - DebugViewC.shared.setViewID(VIEW_SETTINGS, stack: stack.push()) + DebugViewC.shared.setViewID(VIEW_SETTINGS3, stack: stack.push()) } .onDisappear() { checkDisabled = false // reset diff --git a/TalerWallet1/Views/Transactions/TransactionRowView.swift b/TalerWallet1/Views/Transactions/TransactionRowView.swift @@ -44,6 +44,7 @@ struct TransactionRowView: View { #else @AppStorage("developerMode") var developerMode: Bool = false #endif + @AppStorage("debugViews") var debugViews: Bool = false @State private var layoutStati0: [Int: Bool] = [:] @State private var layoutStati1: [Int: Bool] = [:] @@ -86,11 +87,11 @@ struct TransactionRowView: View { } } #if TALER_NIGHTLY - var red: Color { developerMode ? Color.red : Color.clear } - var green: Color { developerMode ? Color.green : Color.clear } - var blue: Color { developerMode ? Color.blue : Color.clear } - var orange: Color { developerMode ? Color.orange : Color.clear } - var purple: Color { developerMode ? Color.purple : Color.clear } + var red: Color { developerMode && debugViews ? Color.red : Color.clear } + var green: Color { developerMode && debugViews ? Color.green : Color.clear } + var blue: Color { developerMode && debugViews ? Color.blue : Color.clear } + var orange: Color { developerMode && debugViews ? Color.orange : Color.clear } + var purple: Color { developerMode && debugViews ? Color.purple : Color.clear } #endif var common: TransactionCommon { transaction.common } diff --git a/TalerWallet1/Views/Transactions/TransactionsListView.swift b/TalerWallet1/Views/Transactions/TransactionsListView.swift @@ -152,6 +152,8 @@ struct TransactionsArraySection: View { #else @AppStorage("developerMode") var developerMode: Bool = false #endif + @AppStorage("debugViews") var debugViews: Bool = false + @State private var talerTX: TalerTransaction = TalerTransaction(dummyCurrency: DEMOCURRENCY) @State private var padd = 0 @@ -204,7 +206,7 @@ struct TransactionsArraySection: View { } } header: { #if TALER_NIGHTLY - if developerMode { + if developerMode && debugViews { HStack(spacing: 50) { Button("<") { padd -= 1 } Button("\(padd)") { padd = 0 }