Remove SelectionSections

This commit is contained in:
2024-10-25 22:19:04 +01:00
parent a20fc48eaa
commit d93c548d3c
15 changed files with 202 additions and 195 deletions
+5 -4
View File
@@ -14,6 +14,7 @@ module Dodge.Render.List (
selSecDrawCursorAt,
) where
import qualified Data.IntMap.Strict as IM
import Data.Maybe
import Dodge.Base.Window
import Dodge.Data.CardinalPoint
@@ -86,13 +87,13 @@ selSecDrawCursorAt ::
Int ->
ListDisplayParams ->
CursorDisplay ->
SelectionSections a ->
IM.IntMap (SelectionSection a) ->
(Int, Int) ->
Picture
selSecDrawCursorAt xsize ldp curs sss (i, j) = fromMaybe mempty $ do
yint <- selSecYint i j sss
xint <- sss ^? sssSections . ix i . ssIndent
si <- sss ^? sssSections . ix i . ssItems . ix j
xint <- sss ^? ix i . ssIndent
si <- sss ^? ix i . ssItems . ix j
return $
listCursorChooseBorderScale
(ldp ^. ldpVerticalGap)
@@ -108,7 +109,7 @@ selSecDrawCursor ::
Int ->
ListDisplayParams ->
CursorDisplay ->
SelectionSections a ->
IM.IntMap (SelectionSection a) ->
Maybe (Int, Int) ->
Picture
selSecDrawCursor xsize ldp curs = maybe mempty . selSecDrawCursorAt xsize ldp curs