summaryrefslogtreecommitdiffhomepage
path: root/Xmobar.hs
diff options
context:
space:
mode:
authorNorbert Zeh <nzeh@cs.dal.ca>2009-07-31 04:55:56 +0200
committerNorbert Zeh <nzeh@cs.dal.ca>2009-07-31 04:55:56 +0200
commit41516032e70037075733a0fb7a256fd3a544f4af (patch)
treec3972d159c3b51b178936496c3798ec5531ae650 /Xmobar.hs
parentff3bfeeb4565f53a2530775e531954cab048bdf1 (diff)
downloadxmobar-41516032e70037075733a0fb7a256fd3a544f4af.tar.gz
xmobar-41516032e70037075733a0fb7a256fd3a544f4af.tar.bz2
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
Diffstat (limited to 'Xmobar.hs')
-rw-r--r--Xmobar.hs5
1 files changed, 4 insertions, 1 deletions
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