From f4561dc66220c9aabcedd7aba652261f53923e48 Mon Sep 17 00:00:00 2001 From: Jonathan Daugherty Date: Tue, 27 Dec 2022 15:56:11 -0800 Subject: [PATCH] TabularListDemo: update cursor location text --- programs/TabularListDemo.hs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/programs/TabularListDemo.hs b/programs/TabularListDemo.hs index 64dc945..a1d6c62 100644 --- a/programs/TabularListDemo.hs +++ b/programs/TabularListDemo.hs @@ -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 $