From f87db080eb36141247d50175a24331cc3f663902 Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Sun, 23 Oct 2022 15:43:03 -0400 Subject: header shows selected week --- repgoal.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/repgoal.hs b/repgoal.hs index 8492ce8..94982f1 100755 --- a/repgoal.hs +++ b/repgoal.hs @@ -163,9 +163,10 @@ annotatePosition (x:xs) = (FirstInList, x) : annotateRest xs annotateRest (x:xs) = (MiddleInList, x) : annotateRest xs drawUI :: St -> [Widget ()] -drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] +drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, header, withVScrollBarHandles $ withVScrollBars OnRight $ viewport () Vertical $ hCenter lastSetTable]] where lastSetTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Set", "Goal"] : concatMap (toLiftRows (view week st)) (view lifts st) + header = str $ "Week " ++ case (view week st) of Week1 -> "1"; Week2 -> "2"; Week3 -> "3" oneRepMaxTable = renderTable $ table $ map (padLeftRight 1 . str) ["Lift", "Achieved Best", "Computed 1RM"] : map toRow (view lifts st) toRow LiftRecord{..} = let best@Achieved{..} = bestPerformance stats @@ -191,7 +192,6 @@ drawUI st = [vCenter $ vBox [hCenter oneRepMaxTable, withVScrollBarHandles $ wit [ -- txt $ if position == FirstInList then liftName else " ", txt $ case position of FirstInList -> liftName; LastInList -> " \n "; _ -> " ", - -- txt $ case week of Week1 -> "1"; Week2 -> "2"; Week3 -> "3", str $ printf "%2d%s @ %d%s" targetReps (if position == LastInList then "+" else "" :: Text) targetWeight (if position == LastInList then "\n " else "" :: String), str $ if position /= LastInList then " " else showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) -- str $ if position /= LastInList then " " else showGoal repGoal, -- cgit v1.2.3