Work on selection lists and option menus

This commit is contained in:
2022-12-23 22:43:30 +00:00
parent b072dc9e9a
commit 5356d21778
5 changed files with 49 additions and 33 deletions
+10
View File
@@ -24,3 +24,13 @@ setShownSelectionItems' maxlines offset sl = case sl ^? scListDisplayParams . ld
where
-- dummyitem = (SelectionItem [] 1 False 0 white 0, DummySelectionItem)
allitems = zipWith (\x y -> (x,ListedSelectionItem y)) (sl ^. scSelectionList . slItems) [0..]
getAvailableListLines :: ListDisplayParams -> Configuration -> Int
getAvailableListLines ldps cfig = nlines
where
nlines = floor ((dToBot - vgap) / itmHeight)
vgap = ldps ^. ldpVerticalGap
itmHeight = 10 * ldps ^. ldpScale + vgap
dToBot = cfig ^. windowY - (ldps ^. ldpPosY + dFromScreenBot)
dFromScreenBot = 5 -- fromMaybe 0 $ sl ^? slSizeRestriction . ssrType . ssrFromScreenBottom