diff --git a/src/Mtlstats/Control/EditStandings.hs b/src/Mtlstats/Control/EditStandings.hs index 1ad18ae..a6ffcf3 100644 --- a/src/Mtlstats/Control/EditStandings.hs +++ b/src/Mtlstats/Control/EditStandings.hs @@ -24,7 +24,7 @@ along with this program. If not, see . module Mtlstats.Control.EditStandings (editStandingsC) where import Brick.Types (Widget) -import Brick.Widgets.Core (str, vBox) +import Brick.Widgets.Core (vBox) import Lens.Micro ((^.)) import Mtlstats.Format @@ -34,6 +34,7 @@ import Mtlstats.Prompt import Mtlstats.Prompt.EditStandings import Mtlstats.Types import Mtlstats.Types.Menu +import Mtlstats.Util -- | Controller for the edit standings menu editStandingsC :: EditStandingsMode -> Controller @@ -75,7 +76,10 @@ header s w = let [ ( "HOME", valsFor home ) , ( "ROAD", valsFor away ) ] - in vBox $ map str (table ++ [""]) ++ [w] + in vBox + [ linesToWidget $ table ++ [""] + , w + ] valsFor :: GameStats -> [Int] valsFor gs = diff --git a/src/Mtlstats/Control/NewGame.hs b/src/Mtlstats/Control/NewGame.hs index 318a60d..21a6d13 100644 --- a/src/Mtlstats/Control/NewGame.hs +++ b/src/Mtlstats/Control/NewGame.hs @@ -103,7 +103,7 @@ verifyDataC :: Controller verifyDataC = Controller { drawController = \s -> let gs = s^.progMode.gameStateL - in header s $ vBox $ map str $ + in header s $ linesToWidget $ [""] ++ labelTable [ ( "Date", gameDate gs ) @@ -172,7 +172,7 @@ confirmGoalDataC = Controller [ "" , "Is the above information correct? (Y/N)" ] - in vBox $ map str msg + in linesToWidget msg , handleController = \e -> do case ynHandler e of Just True -> modify recordGoalAssists @@ -201,7 +201,7 @@ getPMinsC = Controller reportC :: Controller reportC = Controller - { drawController = viewport () Vertical . hCenter . vBox . map str . + { drawController = viewport () Vertical . hCenter . linesToWidget . displayReport reportCols , handleController = \e -> do scr <- use scroller @@ -239,8 +239,11 @@ monthHeader s w = let , "NOVEMBER" , "DECEMBER" ] - in header s $ vBox $ map (hCenter . str) - (["MONTH:", ""] ++ table ++ [""]) ++ [w] + in header s $ vBox + [ linesToWidgetC $ + ["MONTH:", ""] ++ table ++ [""] + , w + ] gameGoal :: ProgState -> (Int, Int) gameGoal s =