aboutsummaryrefslogtreecommitdiff
path: root/src/Chelleport/Context.hs
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2024-12-25 14:25:09 +0530
committerAkshay Nair <phenax5@gmail.com>2024-12-25 14:25:09 +0530
commit4e74eeebbaa441cda3a6846c47d82516878f8f05 (patch)
tree7a67bfd8cfbef2092931fd4d12a8ce69b3b3d2d4 /src/Chelleport/Context.hs
parent82d612b7c37b432bc4abd8e158d6fe076d391ddc (diff)
downloadchelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.tar.gz
chelleport-4e74eeebbaa441cda3a6846c47d82516878f8f05.zip
Add searching indication text for search mode + a lot of refactoring
Diffstat (limited to '')
-rw-r--r--src/Chelleport/Context.hs17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/Chelleport/Context.hs b/src/Chelleport/Context.hs
index 30d8516..3109e05 100644
--- a/src/Chelleport/Context.hs
+++ b/src/Chelleport/Context.hs
@@ -19,7 +19,7 @@ initializeContext = do
window <- initializeWindow
renderer <- initializeRenderer window
- font <- loadFont
+ (fontSm, fontLg) <- loadFonts
display <- X11.openDisplay ""
@@ -27,18 +27,21 @@ initializeContext = do
DrawContext
{ ctxWindow = window,
ctxRenderer = renderer,
- ctxFont = font,
+ ctxFontLarge = fontLg,
+ ctxFontSmall = fontSm,
ctxX11Display = display
}
rawFontData :: ByteString
rawFontData = $(embedFileRelative "./static/font.ttf")
-loadFont :: IO TTF.Font
-loadFont = do
- font <- TTF.decode rawFontData fontSize
- TTF.setStyle font [TTF.Bold]
- pure font
+loadFonts :: IO (TTF.Font, TTF.Font)
+loadFonts = do
+ fontSm <- TTF.decode rawFontData 14
+ TTF.setStyle fontSm [TTF.Bold]
+ fontLg <- TTF.decode rawFontData 24
+ TTF.setStyle fontLg [TTF.Bold]
+ pure (fontSm, fontLg)
initializeRenderer :: SDL.Window -> IO SDL.Renderer
initializeRenderer window = do