[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[taler-taler-ios] 33/69: bars relative to fontSize
From: |
gnunet |
Subject: |
[taler-taler-ios] 33/69: bars relative to fontSize |
Date: |
Fri, 19 Jan 2024 09:02:06 +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 c8adbe5082fdda1e210a75976da05ef4e35e2178
Author: Marc Stibane <marc@taler.net>
AuthorDate: Thu Jan 4 17:53:16 2024 +0100
bars relative to fontSize
---
TalerWallet1/Views/HelperViews/BarGraph.swift | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/TalerWallet1/Views/HelperViews/BarGraph.swift
b/TalerWallet1/Views/HelperViews/BarGraph.swift
index 92c6e69..e7b60ef 100644
--- a/TalerWallet1/Views/HelperViews/BarGraph.swift
+++ b/TalerWallet1/Views/HelperViews/BarGraph.swift
@@ -16,6 +16,7 @@ struct BarGraphHeader: View {
@Environment(\.colorSchemeContrast) private var colorSchemeContrast
@State private var completedTransactions: [Transaction] = []
+ @ScaledMetric var barHeight = 9 // relative to fontSize
var body: some View {
HStack (alignment: .center, spacing: 10) {
@@ -23,7 +24,7 @@ struct BarGraphHeader: View {
.accessibilityFont(.title2)
// .foregroundColor(colorSchemeContrast == .increased ?
.primary : .secondary)
BarGraph(transactions: $completedTransactions,
- maxBars: MAXBARS, barHeight: 10) // TODO: barHeight
relative to fontSize
+ maxBars: MAXBARS, barHeight: barHeight)
}
.task {
symLog.log(".task for BarGraphHeader(\(currency)) - reload
Transactions")
@@ -38,7 +39,7 @@ struct BarGraphHeader: View {
struct BarGraph: View {
@Binding var transactions: [Transaction]
let maxBars: Int
- let barHeight : Double
+ let barHeight: Double
func maxValue(_ someTransactions: [Transaction]) -> Double {
var maxValue = 0.0
@@ -67,15 +68,16 @@ struct BarGraph: View {
let valueTransparent = barHeight - valueColored
// let _ = print("max: \(maxValue), ", incoming ? "+" :
"-", netto)
VStack(spacing: 0) {
+ let width = barHeight / 3
Rectangle()
.opacity(0.001)
- .frame (width: 3, height: incoming ?
valueTransparent : barHeight )
+ .frame (width: width, height: incoming ?
valueTransparent : barHeight )
Rectangle()
.foregroundColor(incoming ? .green : .red)
- .frame (width: 3, height: valueColored )
+ .frame (width: width, height: valueColored )
Rectangle()
.opacity(0.001)
- .frame (width: 3, height: incoming ? barHeight :
valueTransparent)
+ .frame (width: width, height: incoming ? barHeight
: valueTransparent)
}
}
}
--
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.
- [taler-taler-ios] 67/69: Bump version to 0.9.4 (0), (continued)
- [taler-taler-ios] 67/69: Bump version to 0.9.4 (0), gnunet, 2024/01/19
- [taler-taler-ios] 68/69: lowercased(), gnunet, 2024/01/19
- [taler-taler-ios] 54/69: Keyboard needs more time, gnunet, 2024/01/19
- [taler-taler-ios] 49/69: accessibilityDate, gnunet, 2024/01/19
- [taler-taler-ios] 46/69: AccountRestriction, gnunet, 2024/01/19
- [taler-taler-ios] 59/69: bugfix, gnunet, 2024/01/19
- [taler-taler-ios] 43/69: currency == ISO 4217, gnunet, 2024/01/19
- [taler-taler-ios] 56/69: remove "code", since "currency" IS ISO-4217 already for global, gnunet, 2024/01/19
- [taler-taler-ios] 58/69: use scopeInfo, gnunet, 2024/01/19
- [taler-taler-ios] 52/69: return to Balances after tx, gnunet, 2024/01/19
- [taler-taler-ios] 33/69: bars relative to fontSize,
gnunet <=
- [taler-taler-ios] 63/69: Locale.preferredLanguageCode, gnunet, 2024/01/19
- [taler-taler-ios] 40/69: Exchange -> Banking, gnunet, 2024/01/19
- [taler-taler-ios] 65/69: Restrictions, gnunet, 2024/01/19
- [taler-taler-ios] 62/69: cleanup, preview, gnunet, 2024/01/19
- [taler-taler-ios] 36/69: b-i-withdrawal hint, gnunet, 2024/01/19
- [taler-taler-ios] 45/69: remove SideBarView, gnunet, 2024/01/19
- [taler-taler-ios] 69/69: Bump version to 0.9.4 (1), gnunet, 2024/01/19
- [taler-taler-ios] 61/69: InfiniteTransactionLoop, gnunet, 2024/01/19
- [taler-taler-ios] 55/69: logging, gnunet, 2024/01/19
- [taler-taler-ios] 42/69: remove payto scheme, gnunet, 2024/01/19