diff options
author | Unoqwy <julien.qwy@gmail.com> | 2020-07-24 10:22:49 +0200 |
---|---|---|
committer | Unoqwy <julien.qwy@gmail.com> | 2020-08-07 19:49:33 +0200 |
commit | afc7a9eff0c3b65b0df83e05dd90d2c2c8202a6c (patch) | |
tree | d38323ae0487e92521fe6c4f3bc7ec943ed6211a /src/Xmobar/App | |
parent | 43d1dc71f9900986168458d3af281453f41df966 (diff) | |
download | xmobar-afc7a9eff0c3b65b0df83e05dd90d2c2c8202a6c.tar.gz xmobar-afc7a9eff0c3b65b0df83e05dd90d2c2c8202a6c.tar.bz2 |
Refactor ColorInfo to TextRenderInfo
ColorInfo contains background offsets, it is no longer only about colors
TextRenderInfo can hold information such as color, offsets, etc
Diffstat (limited to 'src/Xmobar/App')
-rw-r--r-- | src/Xmobar/App/EventLoop.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Xmobar/App/EventLoop.hs b/src/Xmobar/App/EventLoop.hs index 2b33768..1c77ac1 100644 --- a/src/Xmobar/App/EventLoop.hs +++ b/src/Xmobar/App/EventLoop.hs @@ -250,17 +250,17 @@ startCommand sig (com,s,ss) where is = s ++ "Updating..." ++ ss updateString :: Config -> TVar [String] - -> IO [[(Widget, ColorInfo, Int, Maybe [Action])]] + -> IO [[(Widget, TextRenderInfo, Int, Maybe [Action])]] updateString conf v = do s <- readTVarIO v let l:c:r:_ = s ++ repeat "" liftIO $ mapM (parseString conf) [l, c, r] -updateActions :: XConf -> Rectangle -> [[(Widget, ColorInfo, Int, Maybe [Action])]] +updateActions :: XConf -> Rectangle -> [[(Widget, TextRenderInfo, Int, Maybe [Action])]] -> IO [([Action], Position, Position)] updateActions conf (Rectangle _ _ wid _) ~[left,center,right] = do let (d,fs) = (display &&& fontListS) conf - strLn :: [(Widget, ColorInfo, Int, Maybe [Action])] -> IO [(Maybe [Action], Position, Position)] + strLn :: [(Widget, TextRenderInfo, Int, Maybe [Action])] -> IO [(Maybe [Action], Position, Position)] strLn = liftIO . mapM getCoords iconW i = maybe 0 Bitmap.width (lookup i $ iconS conf) getCoords (Text s,_,i,a) = textWidth d (safeIndex fs i) s >>= \tw -> return (a, 0, fi tw) |