diff options
author | Unoqwy <julien.qwy@gmail.com> | 2020-07-24 01:53:15 +0200 |
---|---|---|
committer | Unoqwy <julien.qwy@gmail.com> | 2020-08-07 19:49:26 +0200 |
commit | 43d1dc71f9900986168458d3af281453f41df966 (patch) | |
tree | 47fb1e3c12f71051d16ccfb23001f0091e8541ef /src/Xmobar/App/EventLoop.hs | |
parent | 9891cd087f311c5b248bf8e7bd68d03946f3de48 (diff) | |
download | xmobar-43d1dc71f9900986168458d3af281453f41df966.tar.gz xmobar-43d1dc71f9900986168458d3af281453f41df966.tar.bz2 |
Allow font bg to be taller (or smaller)
Implemented only for XFT fonts.
Adds a new "part" in the fc tag.
> Example: <fc=white,gray:0>foo bar</fc> will make the font background
as tall as the bar (absolute offset, here set to 0 for both top &
bottom)
Changes ColorString to ColorInfo, containing both top and bottom
offsets. The "colors string" is still in only one string.
Diffstat (limited to 'src/Xmobar/App/EventLoop.hs')
-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 e6232cd..2b33768 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, String, Int, Maybe [Action])]] + -> IO [[(Widget, ColorInfo, 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, String, Int, Maybe [Action])]] +updateActions :: XConf -> Rectangle -> [[(Widget, ColorInfo, Int, Maybe [Action])]] -> IO [([Action], Position, Position)] updateActions conf (Rectangle _ _ wid _) ~[left,center,right] = do let (d,fs) = (display &&& fontListS) conf - strLn :: [(Widget, String, Int, Maybe [Action])] -> IO [(Maybe [Action], Position, Position)] + strLn :: [(Widget, ColorInfo, 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) |