switch from ncurses to brick #1

Merged
jlamothe merged 21 commits from brick into dev 2023-06-02 15:28:41 -04:00
Showing only changes of commit 5ea2d77921 - Show all commits

View File

@ -23,7 +23,9 @@ module Mtlstats (app) where
import Brick.AttrMap (AttrMap, forceAttrMap)
import Brick.Main (App (..), showFirstCursor)
import Brick.Types (Widget)
import Brick.Util (on)
import Brick.Widgets.Core (fill)
import Graphics.Vty.Attributes.Color (blue, white)
import Lens.Micro (to)
import Lens.Micro.Mtl (use)
@ -34,13 +36,19 @@ import Mtlstats.Types
-- | The main application
app :: App ProgState () ()
app = App
{ appDraw = \s -> [drawController (dispatch s) s]
{ appDraw = draw
, appChooseCursor = showFirstCursor
, appHandleEvent = handler
, appStartEvent = return ()
, appAttrMap = const myAttrMap
}
draw :: ProgState -> [Widget ()]
draw s =
[ drawController (dispatch s) s
, fill ' '
]
handler :: Handler ()
handler e = do
c <- use (to dispatch)