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