Cleanup, hide item selection cursor when in terminal

This commit is contained in:
2025-12-24 13:45:38 +00:00
parent 6becda01d5
commit 8cd2625548
11 changed files with 262 additions and 295 deletions
+5 -18
View File
@@ -33,7 +33,7 @@ import LensHelp
import ListHelp
import Picture
drawSelectionList :: ListDisplayParams -> Config -> [SelectionItem a] -> Picture
drawSelectionList :: LDParams -> Config -> [SelectionItem a] -> Picture
drawSelectionList ldps cfig sl =
translateScreenPos cfig (ldps ^. ldpPos) $
drawListYgapScaleYoff ygap sf 0 (makeSelectionListPictures sl)
@@ -57,7 +57,7 @@ drawTitleBackground cfig =
$ rectNSWE 70 0 0 560
drawSelectionListBackground ::
ListDisplayParams ->
LDParams ->
Config ->
Int -> -- list length
Picture
@@ -77,12 +77,7 @@ makeSelectionListPictures = concatMap f
-- note this does not take into account any selectionsection indent
drawCursorAt ::
Maybe Int ->
[SelectionItem a] ->
ListDisplayParams ->
Int ->
CursorDisplay ->
Picture
Maybe Int -> [SelectionItem a] -> LDParams -> Int -> CursorDisplay -> Picture
drawCursorAt mi lis ldps width curs = fromMaybe mempty $ do
i <- mi
selit <- lis !? i
@@ -110,11 +105,7 @@ stackPicturesAtOff :: Int -> [Picture] -> Picture
stackPicturesAtOff i = mconcat . zipWith (drawListElement 10 1 0) [i, i - 1 ..]
selSecDrawCursorAt ::
ListDisplayParams ->
CursorDisplay ->
IM.IntMap (SelSection a) ->
(Int, Int) ->
Picture
LDParams -> CursorDisplay -> IM.IntMap (SelSection a) -> (Int, Int) -> Picture
selSecDrawCursorAt ldp curs sss (i, j) = fold $ do
yint <- selSecYint i j sss
sindent <- sss ^? ix i . ssIndent
@@ -131,11 +122,7 @@ selSecDrawCursorAt ldp curs sss (i, j) = fold $ do
(_siHeight si)
selSecDrawCursor ::
ListDisplayParams ->
CursorDisplay ->
IM.IntMap (SelSection a) ->
Maybe (Int, Int) ->
Picture
LDParams -> CursorDisplay -> IM.IntMap (SelSection a) -> Maybe (Int, Int) -> Picture
selSecDrawCursor ldp curs = maybe mempty . selSecDrawCursorAt ldp curs
-- displays a cursor that should match up to list text pictures