List demo improvements

This commit is contained in:
Jonathan Daugherty 2015-06-28 20:05:30 -07:00
parent 361046b203
commit 0faa130f13

View File

@ -54,11 +54,11 @@ listDrawElement sel i =
let selStr s = if sel
then withAttrName customAttr (str $ "<" <> s <> ">")
else str s
in hCenterWith (Just ' ') $ vBox $ for [1..i+1] $ \j ->
"Item " <+> (selStr $ show i) <+> " Line " <+> (str $ show j)
in (hCenterWith (Just ' ') $ vBox $ for [1..i+1] $ \j ->
"Item " <+> (selStr $ show i) <+> " Line " <+> (str $ show j)) <=> hBorder
initialState :: List Int
initialState = list (Name "list") listDrawElement [1, 2, 3]
initialState = list (Name "list") listDrawElement [0, 1, 2]
customAttr :: AttrName
customAttr = listSelectedAttr <> "custom"