Rethink unselectable items in lists
This commit is contained in:
@@ -35,11 +35,13 @@ makeSelectionListPictures sl = concatMap _siPictures $ _slItems sl
|
||||
drawSelectionCursor :: ListDisplayParams -> Configuration -> SelectionList a -> Picture
|
||||
drawSelectionCursor ldps cfig sl = fromMaybe mempty $ do
|
||||
i <- _slSelPos sl
|
||||
selit <- filter _siIsSelectable lis !? i
|
||||
--selit <- filter _siIsSelectable lis !? i
|
||||
selit <- lis !? i
|
||||
f <- case _ldpCursorType ldps of
|
||||
BorderCursor cps -> Just $ listCursorChooseBorderScale (_ldpVerticalGap ldps) (_ldpScale ldps) cps
|
||||
NoCursor -> Nothing
|
||||
let j = sum . map _siHeight $ takeWhileArb (<= i) (\x itsel -> x + if _siIsSelectable itsel then 1 else 0) 0 lis
|
||||
--let j = sum . map _siHeight $ takeWhileArb (<= i) (\x itsel -> x + if _siIsSelectable itsel then 1 else 0) 0 lis
|
||||
let j = sum . map _siHeight $ takeWhileArb (<= i) (\x itsel -> x + 1) 0 lis
|
||||
col = _siColor selit
|
||||
return $ f (_ldpPosX ldps + (9 * fromIntegral (_siOffX selit))) (_ldpPosY ldps) cfig j col wdth (_siHeight selit)
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user