mirror of
https://github.com/jtdaugherty/brick.git
synced 2024-08-16 19:30:21 +03:00
TabularListDemo: update cursor location text
This commit is contained in:
parent
16666f3891
commit
f4561dc662
@ -23,8 +23,7 @@ import Brick.Types
|
|||||||
( Widget
|
( Widget
|
||||||
)
|
)
|
||||||
import Brick.Widgets.Core
|
import Brick.Widgets.Core
|
||||||
( (<+>)
|
( (<=>)
|
||||||
, (<=>)
|
|
||||||
, str
|
, str
|
||||||
, vLimit
|
, vLimit
|
||||||
, hLimit
|
, hLimit
|
||||||
@ -47,11 +46,10 @@ drawUI :: AppState -> [Widget ()]
|
|||||||
drawUI s = [ui]
|
drawUI s = [ui]
|
||||||
where
|
where
|
||||||
l = s^.tabularList
|
l = s^.tabularList
|
||||||
label = str "Item " <+> cur <+> str " of " <+> total
|
label = str $ "Row " <> cur <> " / col " <> show (s^.colIndex + 1)
|
||||||
cur = case l^.(L.listSelectedL) of
|
cur = case l^.(L.listSelectedL) of
|
||||||
Nothing -> str "-"
|
Nothing -> "-"
|
||||||
Just i -> str (show (i + 1))
|
Just i -> show (i + 1)
|
||||||
total = str $ show $ Vec.length $ l^.(L.listElementsL)
|
|
||||||
box = B.borderWithLabel label $
|
box = B.borderWithLabel label $
|
||||||
hLimit totalWidth $
|
hLimit totalWidth $
|
||||||
vLimit 15 $
|
vLimit 15 $
|
||||||
|
Loading…
Reference in New Issue
Block a user