From 8774723f4389a610a0c6e0db3c3ee69d7ced645d Mon Sep 17 00:00:00 2001 From: saint Date: Fri, 31 May 2024 14:23:36 -0400 Subject: [PATCH] better stats formatting --- Stats.swift | 78 +++++++++++++++++++---------------------- gloss/ContentView.swift | 4 +-- 2 files changed, 38 insertions(+), 44 deletions(-) diff --git a/Stats.swift b/Stats.swift index 26b24ed..9550f4f 100644 --- a/Stats.swift +++ b/Stats.swift @@ -19,58 +19,52 @@ struct StatsPanel: View { Array(repeatElement(GridItem(.flexible()), count: columnCount)) } var body: some View { - LazyVGrid (columns:columns , spacing: 5) { - VStack { - Text("back Ribbon") - .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) - RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: backRibbon[0])) - } + HStack(spacing: 5) { + VStack (spacing: 5) { - VStack { - Text("next Ribbon") - .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) - if (nextRibbon.count > 0) { - RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: nextRibbon[0])) + VStack { + Text("back Ribbon") + .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) + RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: backRibbon[0])) + } + + VStack { + Text("next Ribbon") + .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) + if nextRibbon.count > 0 { + RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: nextRibbon[0])) + } + } + + VStack { + Text("selected Ribbon") + .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) + RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: selectedRibbon[0])) + } + + VStack { + Text("pc offset: \(paneConnector.currentOffset)") + .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) + } + + VStack { + Text("pc id: \(paneConnector.currentId)") + .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) + .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) } } - VStack { - Text("selected Ribbon") - .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) - RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: selectedRibbon[0])) - } - - + VStack (spacing: 5) { ForEach(RibbonMap(ribbons: allRibbons), id: \.self) { ribbon in Print("quack3: \(ribbon)") RibbonDebug(ribbonDebug: ribbon) } - - //VStack(spacing: 10) { - // Text("All Ribbons") - // .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - // .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) - - // ForEach(RibbonMap(ribbons: allRibbons), id: \.self) { ribbon in - // //Print("quack2: \(ribbon)") - // RibbonDebug(ribbonDebug: RibbonDebugPrint(ribbon: ribbon)) - // } - //} - - VStack { - Text("pc offset: \(paneConnector.currentOffset)") - .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) } - VStack { - Text("pc id: \(paneConnector.currentId)") - .foregroundColor(Color(UIColor(red: 0.76, green: 0.76, blue: 0.76, alpha: 1.00))) - .font(Font.custom("AveriaSerifLibre-Regular", size: fontSize)) - } } } } diff --git a/gloss/ContentView.swift b/gloss/ContentView.swift index cbf9536..ed544f2 100644 --- a/gloss/ContentView.swift +++ b/gloss/ContentView.swift @@ -235,8 +235,8 @@ class PaneConnector: NSObject, ObservableObject { var currentId = "" var currentOffset = CGFloat() var visibilityTracker: VisibilityTracker? - var scrollId = "" - var scrollOffset = CGFloat() + @Published var scrollId = "" + @Published var scrollOffset = CGFloat() var setScrollOffset: CGFloat? }