From 41516032e70037075733a0fb7a256fd3a544f4af Mon Sep 17 00:00:00 2001 From: Norbert Zeh Date: Fri, 31 Jul 2009 04:55:56 +0200 Subject: Full-height colour boxes around text Ignore-this: b1339bf8b7ed3ee816233d1dd386bd0a Didn't like the fact that strings with the non-default background had two pixels of default background above and below it. Made the boxes with the custom background colour extend to the full height of the status bar. darcs-hash:20090731025556-18a2b-445313d476ee671e20799bab46f4d5f5db497057.gz --- Xmobar.hs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Xmobar.hs b/Xmobar.hs index 7128074..1ad18e1 100644 --- a/Xmobar.hs +++ b/Xmobar.hs @@ -271,7 +271,7 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do r <- ask (as,ds) <- io $ textExtents fontst s let (conf,d) = (config &&& display) r - Rectangle _ _ wid _ = rect r + Rectangle _ _ wid ht = rect r totSLen = foldr (\(_,_,len) -> (+) len) 0 sl valign = fi $ as + ds remWidth = fi wid - fi totSLen @@ -282,5 +282,8 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do (fc,bc) = case (break (==',') c) of (f,',':b) -> (f, b ) (f, _) -> (f, bgColor conf) + withColors d [bc] $ \[bc'] -> do + io $ setForeground d gc bc' + io $ fillRectangle d dr gc offset 0 (fi l) ht io $ printString d dr fontst gc fc bc offset valign s printStrings dr gc fontst (offs + l) a xs -- cgit v1.2.3