centred title screen

This commit is contained in:
Jonathan Lamothe
2020-01-22 13:43:58 -05:00
parent 9c2e2291c8
commit f2b2ff3fef

View File

@@ -28,18 +28,21 @@ import Data.Char (chr)
import qualified UI.NCurses as C import qualified UI.NCurses as C
import Mtlstats.Actions import Mtlstats.Actions
import Mtlstats.Format
import Mtlstats.Types import Mtlstats.Types
titleScreenC :: Controller titleScreenC :: Controller
titleScreenC = Controller titleScreenC = Controller
{ drawController = const $ do { drawController = const $ do
C.drawString $ unlines $ titleText ++ (_, cols) <- C.windowSize
[ "" C.drawString $ unlines $ map (centre $ fromIntegral $ pred cols)
, "Copyright (C) 1984, 1985, 2019, 2020 Rhéal Lamothe" $ titleText
, "<rheal.lamothe@gmail.com>" ++ [ ""
, "" , "Copyright (C) 1984, 1985, 2019, 2020 Rhéal Lamothe"
, "Press any key to continue..." , "<rheal.lamothe@gmail.com>"
] , ""
, "Press any key to continue..."
]
return C.CursorInvisible return C.CursorInvisible
, handleController = \case , handleController = \case
C.EventCharacter _ -> modify backHome >> return True C.EventCharacter _ -> modify backHome >> return True