Highlight row names above

This commit is contained in:
Joscha 2020-03-01 09:41:53 +00:00
parent 57e77f3f69
commit c76a16bcbe

View file

@ -24,7 +24,7 @@ data UiState = UiState
} deriving (Show) } deriving (Show)
newUiState :: [T.Text] -> LineNode -> UiState newUiState :: [T.Text] -> LineNode -> UiState
newUiState info ln = UiState info ln $ list UiList (flatten ln) 1 newUiState info ln = toggleFold $ UiState info ln $ list UiList (flatten ln) 1
toggleFold :: UiState -> UiState toggleFold :: UiState -> UiState
toggleFold s = case listSelectedElement (uiList s) of toggleFold s = case listSelectedElement (uiList s) of
@ -51,8 +51,8 @@ renderLine focused (_, ln)
renderUiState :: UiState -> Widget UiName renderUiState :: UiState -> Widget UiName
renderUiState s = renderUiState s =
let info = vBox $ map (\t -> str " " <+> txt t) $ uiInfo s let info = padRight Max $ vBox $ map (\t -> str " " <+> txt t) $ uiInfo s
in info <=> renderList renderLine True (uiList s) in withDefAttr "info" info <=> renderList renderLine True (uiList s)
{- The actual App -} {- The actual App -}
@ -71,6 +71,7 @@ myHandleEvent s _ = continue s
myAttrMap :: AttrMap myAttrMap :: AttrMap
myAttrMap = attrMap Vty.defAttr myAttrMap = attrMap Vty.defAttr
[ ("focused", Vty.defAttr `Vty.withStyle` Vty.reverseVideo) [ ("focused", Vty.defAttr `Vty.withStyle` Vty.reverseVideo)
, ("info", Vty.defAttr `Vty.withStyle` Vty.reverseVideo)
] ]
myApp :: App UiState () UiName myApp :: App UiState () UiName