Allow selection items to have a payload
This commit is contained in:
@@ -14,7 +14,7 @@ import ListHelp
|
||||
import Picture
|
||||
--import LensHelp
|
||||
|
||||
drawSelectionList :: ListDisplayParams -> Configuration -> SelectionList -> Picture
|
||||
drawSelectionList :: ListDisplayParams -> Configuration -> SelectionList a -> Picture
|
||||
drawSelectionList ldps cfig sl =
|
||||
listPicturesAtScaleOff
|
||||
(_ldpVerticalGap ldps)
|
||||
@@ -26,13 +26,13 @@ drawSelectionList ldps cfig sl =
|
||||
(makeSelectionListPictures sl)
|
||||
<> drawSelectionCursor ldps cfig sl
|
||||
|
||||
makeSelectionListPictures :: SelectionList -> [Picture]
|
||||
makeSelectionListPictures :: SelectionList a -> [Picture]
|
||||
makeSelectionListPictures sl = concatMap _siPictures $ _slItems sl
|
||||
--case sl ^. slSizeRestriction of
|
||||
-- SelectionSizeRestriction {} -> concatMap (_siPictures . fst) $ _slShownItems sl
|
||||
-- _ -> concatMap _siPictures $ _slItems sl
|
||||
|
||||
drawSelectionCursor :: ListDisplayParams -> Configuration -> SelectionList -> Picture
|
||||
drawSelectionCursor :: ListDisplayParams -> Configuration -> SelectionList a -> Picture
|
||||
drawSelectionCursor ldps cfig sl = fromMaybe mempty $ do
|
||||
i <- _slSelPos sl
|
||||
selit <- filter _siIsSelectable lis !? i
|
||||
|
||||
Reference in New Issue
Block a user