mirror of
https://github.com/jtdaugherty/brick.git
synced 2025-01-08 15:08:46 +03:00
Update UI
This commit is contained in:
parent
54f26d9ba5
commit
5a75e0a7b5
@ -33,29 +33,30 @@ data St =
|
||||
|
||||
makeLenses ''St
|
||||
|
||||
kw :: Attr
|
||||
kw = fg blue
|
||||
kw :: String -> Prim a
|
||||
kw = UseAttr (fg blue) . Txt
|
||||
|
||||
drawUI :: St -> [Prim St]
|
||||
drawUI st = [a]
|
||||
where
|
||||
(bsName, bs) = styles !! (st^.stBorderStyle)
|
||||
a = centered $
|
||||
(borderedWithLabel bs bsName $
|
||||
(HLimit 25 (
|
||||
(VLimit 1 $ UseAttr (cyan `on` blue) $ With stEditor drawEditor)
|
||||
<<=
|
||||
hBorder bs
|
||||
=>>
|
||||
(VLimit 10 $ With stList drawList)
|
||||
)))
|
||||
a = vCenter $
|
||||
(hCenter $ borderWithLabel bs bsName $
|
||||
(HLimit 25 (
|
||||
(VLimit 1 $ UseAttr (cyan `on` blue) $ With stEditor drawEditor)
|
||||
<<=
|
||||
hBorder bs
|
||||
=>>
|
||||
(VLimit 10 $ With stList drawList)
|
||||
)))
|
||||
<<=
|
||||
(((UseAttr kw "Enter") <+> " adds a list item")
|
||||
(VLimit 1 $ VPad ' ')
|
||||
=>>
|
||||
(hCenter (kw "Enter" <+> " adds a list item"))
|
||||
<=>
|
||||
((UseAttr kw "+") <+> " changes border styles")
|
||||
(hCenter (kw "+" <+> " changes border styles"))
|
||||
<=>
|
||||
((UseAttr kw "Arrow keys") <+> " navigate the list")
|
||||
)
|
||||
(hCenter (kw "Arrow keys" <+> " navigates the list"))
|
||||
|
||||
appEvent :: Event -> St -> IO St
|
||||
appEvent e st =
|
||||
|
Loading…
Reference in New Issue
Block a user