From dc5a8f2b008d20491b81108a3eccd24e23f379ac Mon Sep 17 00:00:00 2001 From: Andrew Cady Date: Thu, 3 Nov 2022 12:05:26 -0400 Subject: factor --- repgoal.hs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/repgoal.hs b/repgoal.hs index bec0252..ab50b67 100755 --- a/repgoal.hs +++ b/repgoal.hs @@ -191,16 +191,16 @@ drawUI st = [vCenter $ vBox [hCenter $ hBox [header, oneRepMaxTable], withVScrol repGoal = computeRepGoal targetWeight stats goalTo1RM g = computeOneRepMax $ Achieved g targetWeight showGoal g = printf "%2d @ %d ≈ 1 @ %s" g targetWeight (showRational (goalTo1RM g)) + pad = padBottom (Pad $ if amrap then 1 else 0) in map (padLeftRight 2) [ - -- txt $ if position == FirstInList then liftName else " ", - txt $ case position of FirstInList -> liftName; NotFirstInList -> if amrap then " \n " else " ", - str $ printf "%2d%s @ %d%s" targetReps (if amrap then "+" else "" :: Text) targetWeight (if amrap then "\n " else "" :: String), - str $ showPlates targetWeight ++ if amrap then "\n " else "", + pad $ txt $ case position of FirstInList -> liftRecordName; NotFirstInList -> " ", + pad $ str $ printf "%2d%s @ %d" targetReps (if amrap then "+" else "" :: Text) targetWeight, + pad $ str $ showPlates targetWeight, str $ if amrap then showGoal repGoal ++ "\n" ++ showGoal (repGoal + 1) else " ", - txt $ if amrap then " \n " else " ", - txt $ if amrap then " \n " else " " + pad $ txt " ", + pad $ txt " " ] showPlates :: Integer -> String -- cgit v1.2.3