aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/View.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-28 22:14:05 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-28 22:14:05 +0530
commit1bd86a46dcf21a75656edd181f97035739fa238d (patch)
tree3f6e1aafa95351cd3e5d8a3d77bf90630d57e852 /src/Chelleport/View.hs
parent9b5c8368daa97a5b58a378d9c4eab66ebb018cb0 (diff)
downloadchelleport-1bd86a46dcf21a75656edd181f97035739fa238d.tar.gz
chelleport-1bd86a46dcf21a75656edd181f97035739fa238d.zip
Refactor text styles
Diffstat (limited to '')
-rw-r--r--src/Chelleport/View.hs7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/Chelleport/View.hs b/src/Chelleport/View.hs
index 8cb6094..42c23a9 100644
--- a/src/Chelleport/View.hs
+++ b/src/Chelleport/View.hs
@@ -33,7 +33,8 @@ renderSearchView state searchData@(ModeSearchData {searchFilteredWords, searchHi
fillRectVertices (matchStartX, matchStartY) (matchEndX, matchEndY)
(w, h) <- windowSize
- void $ drawText (w `div` 2, h `div` 2) colorWhite FontSM (Text.pack $ getSearchText state searchData)
+ let textStyle = TextStyle {textColor = colorWhite, textSize = FontSM}
+ void $ drawText (w `div` 2, h `div` 2) textStyle (Text.pack $ getSearchText state searchData)
renderHintsView :: (MonadDraw m) => State -> ModeHintsData -> m ()
renderHintsView state (ModeHintsData {stateGrid, stateKeySequence, stateIsMatched}) = do
@@ -63,12 +64,12 @@ renderKeySequence keySequence cell (px, py) = do
previousTextWidth <-
if isNotEmpty matched
- then fst <$> drawText (px, py) colorLightGray FontLG (Text.pack matched)
+ then fst <$> drawText (px, py) (hintLabelTextStyle {textColor = colorLightGray}) (Text.pack matched)
else pure 0
when (isNotEmpty remaining) $ case textColor of
Just color -> do
- void $ drawText (px + previousTextWidth, py) color FontLG $ Text.pack remaining
+ void $ drawText (px + previousTextWidth, py) (hintLabelTextStyle {textColor = color}) $ Text.pack remaining
Nothing -> pure ()
pure isVisible