Improve terminal color possibilities

This commit is contained in:
2024-11-07 18:51:18 +00:00
parent bfd4649e1b
commit ccc966d652
13 changed files with 207 additions and 149 deletions
+17
View File
@@ -3,6 +3,7 @@ module Dodge.Render.List (
renderListAt,
drawList,
drawSelectionList,
drawSelectionListBackground,
drawListYgapScaleYoff,
drawListElement,
selSecDrawCursor,
@@ -12,8 +13,10 @@ module Dodge.Render.List (
toTopLeft,
listCursorChooseBorderScale,
selSecDrawCursorAt,
drawTitleBackground, -- should be renamed, made sensible
) where
import Dodge.ListDisplayParams
import qualified Data.IntMap.Strict as IM
import Data.Maybe
import Dodge.Base.Window
@@ -41,6 +44,20 @@ drawSelectionList ldps cfig sl =
ldps
(BoundaryCursor [North, South])
drawTitleBackground :: Configuration -> Picture
drawTitleBackground cfig =
translateScreenPos cfig (fromTopLeft (V2 (subInvX - 5) 75))
. polygon . reverse $ rectNSWE 70 0 0 560
drawSelectionListBackground :: ListDisplayParams -> Configuration ->
Int -- list length
-> Picture
drawSelectionListBackground ldp cfig l = translateScreenPos cfig (ldp ^. ldpPos) .
polygon . reverse $ rectNSWE 5 s (-5) e
where
s = - (5 + fromIntegral l * (20 * ldp ^. ldpScale + ldp ^. ldpVerticalGap))
e = 555 -- HACK
makeSelectionListPictures :: SelectionList a -> [Picture]
makeSelectionListPictures = concatMap f . _slItems
where