Allow selection items to have a payload
This commit is contained in:
@@ -14,29 +14,15 @@ data ListDisplayParams = ListDisplayParams
|
||||
, _ldpVerticalGap :: Float
|
||||
, _ldpCursorType :: CursorType
|
||||
, _ldpWidth :: SelectionWidth
|
||||
, _ldpSizeRestriction :: SelectionSizeRestriction
|
||||
-- , _ldpSizeRestriction :: SelectionSizeRestriction
|
||||
}
|
||||
|
||||
data SelectionList = SelectionList
|
||||
{ _slItems :: [SelectionItem]
|
||||
data SelectionList a = SelectionList
|
||||
{ _slItems :: [SelectionItem a]
|
||||
, _slSelPos :: Maybe Int
|
||||
, _slLength :: Int
|
||||
}
|
||||
|
||||
data SelectionItemIndex = ListedSelectionItem Int
|
||||
| ScrollSelectionItem
|
||||
| SpecialSelectionItem
|
||||
|
||||
data SpecialSelectionItem = NoSpecialSelectionItem
|
||||
| BottomSelectionItem {_bottomSelectionItem :: SelectionItem}
|
||||
|
||||
data SelectionSizeRestriction = NoSelectionSizeRestriction
|
||||
| SelectionSizeRestriction
|
||||
{ _overflowItemBottom :: SelectionItem
|
||||
}
|
||||
|
||||
newtype SSRType = SSRFromScreenBottom {_ssrFromScreenBottom :: Float}
|
||||
|
||||
data SelectionWidth = FixedSelectionWidth Int
|
||||
| VariableSelectionWidth (Int -> Int)
|
||||
| UseMaxSelectionItemWidth
|
||||
@@ -44,18 +30,16 @@ data SelectionWidth = FixedSelectionWidth Int
|
||||
data CursorType = NoCursor
|
||||
| BorderCursor (Set CardinalPoint)
|
||||
|
||||
data SelectionItem = SelectionItem
|
||||
data SelectionItem a = SelectionItem
|
||||
{ _siPictures :: [Picture]
|
||||
, _siHeight :: Int
|
||||
, _siIsSelectable :: Bool
|
||||
, _siWidth :: Int
|
||||
, _siColor :: Color
|
||||
, _siOffX :: Int
|
||||
, _siPayload :: a
|
||||
}
|
||||
|
||||
makeLenses ''ListDisplayParams
|
||||
makeLenses ''SelectionList
|
||||
makeLenses ''SelectionItem
|
||||
makeLenses ''SpecialSelectionItem
|
||||
makeLenses ''SelectionSizeRestriction
|
||||
makeLenses ''SSRType
|
||||
|
||||
Reference in New Issue
Block a user