Make debug display look better :P
This commit is contained in:
parent
573a835022
commit
31e59616f5
1 changed files with 7 additions and 6 deletions
|
|
@ -3,6 +3,8 @@
|
||||||
module Main where
|
module Main where
|
||||||
|
|
||||||
import Brick
|
import Brick
|
||||||
|
import Brick.Widgets.Border
|
||||||
|
import Brick.Widgets.Border.Style
|
||||||
import Control.Concurrent.Chan
|
import Control.Concurrent.Chan
|
||||||
import Control.Exception
|
import Control.Exception
|
||||||
import Control.Monad
|
import Control.Monad
|
||||||
|
|
@ -51,11 +53,10 @@ newClientState node = ClientState
|
||||||
}
|
}
|
||||||
|
|
||||||
clientDraw :: ClientState -> [Widget ResourceName]
|
clientDraw :: ClientState -> [Widget ResourceName]
|
||||||
clientDraw cs =
|
clientDraw cs = [joinBorders $ withBorderStyle unicode $ debug <=> tree]
|
||||||
[ renderTree boxDrawingBranching (csEditor cs) (csTree cs) <=>
|
where
|
||||||
txt "--------------------------------------------------------------------------------" <=>
|
tree = borderWithLabel (txt "Tree") $ renderTree boxDrawingBranching (csEditor cs) (csTree cs)
|
||||||
txtWrap (T.pack $ show $ csTree cs)
|
debug = borderWithLabel (txt "Debug") $ hLimit 80 $ txtWrap $ T.pack $ show $ csTree cs
|
||||||
]
|
|
||||||
|
|
||||||
isQuitEvent :: BrickEvent a b -> Bool
|
isQuitEvent :: BrickEvent a b -> Bool
|
||||||
isQuitEvent (VtyEvent (Vty.EvKey (Vty.KChar 'q') [])) = True
|
isQuitEvent (VtyEvent (Vty.EvKey (Vty.KChar 'q') [])) = True
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue