Cleanup
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
module Dodge.Render.List where
|
||||
|
||||
import SelectionIntMap
|
||||
import qualified Data.IntMap.Strict as IM
|
||||
--import Data.Foldable
|
||||
import Dodge.SelectionList
|
||||
@@ -63,6 +64,20 @@ drawCursorAt ldps cfig mi lis = fromMaybe mempty $ do
|
||||
FixedSelectionWidth x -> x
|
||||
_ -> 1
|
||||
|
||||
drawCursorAt' :: ListDisplayParams -> Configuration -> Int -> IM.IntMap (SelectionItem a) -> Picture
|
||||
drawCursorAt' ldps cfig i lis = fromMaybe mempty $ do
|
||||
selit <- lis IM.!? i
|
||||
f <- case _ldpCursorType ldps of
|
||||
BorderCursor cps -> Just $ listCursorChooseBorderScale (_ldpVerticalGap ldps) (_ldpScale ldps) cps
|
||||
NoCursor -> Nothing
|
||||
let j = getIthPos i lis
|
||||
col = _siColor selit
|
||||
return $ f (_ldpPosX ldps + (9 * fromIntegral (_siOffX selit))) (_ldpPosY ldps) cfig j col wdth (_siHeight selit)
|
||||
where
|
||||
wdth = case _ldpWidth ldps of
|
||||
FixedSelectionWidth x -> x
|
||||
_ -> 1
|
||||
|
||||
drawSelectionMapCursor :: ListDisplayParams -> Configuration -> SelectionIntMap a -> Picture
|
||||
drawSelectionMapCursor ldps cfig sl = drawCursorAt ldps cfig (sl ^. smSelPos) (IM.elems $ _smShownItems sl)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user