Separate selection list items from display parameters

This commit is contained in:
2022-12-23 12:22:57 +00:00
parent 6ac4e5d669
commit b072dc9e9a
10 changed files with 141 additions and 132 deletions
+5 -4
View File
@@ -16,8 +16,8 @@ import Picture
drawMenuScreen :: Configuration -> ScreenLayer -> Picture
drawMenuScreen cfig screen = case screen of
OptionScreen{_scTitle = titf, _scSelectionList = selpos} ->
drawOptions cfig titf selpos "Use keys to navigate the menu"
OptionScreen{_scTitle = titf, _scSelectionList = selpos, _scListDisplayParams = ldps} ->
drawOptions ldps cfig titf selpos "Use keys to navigate the menu"
-- (WaitScreen sf _) -> drawOptions w (sf w) [] 0 ""
(InputScreen inputstr help) -> drawInputMenu cfig ('>' : T.unpack inputstr) help
-- (DisplayScreen sd) -> sd w
@@ -77,6 +77,7 @@ drawInputMenu cfig title footer =
]
drawOptions ::
ListDisplayParams ->
Configuration ->
-- | Title
String ->
@@ -85,12 +86,12 @@ drawOptions ::
-- | Help Text
String ->
Picture
drawOptions cfig title sl footer =
drawOptions ldps cfig title sl footer =
pictures
[ darkenBackground cfig
, drawTitle cfig title
, drawFooterText cfig red footer
, drawSelectionList cfig sl
, drawSelectionList ldps cfig sl
]
darkenBackground :: Configuration -> Picture