summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorTravis Staton <hello@travisstaton.com>2014-09-10 13:16:35 -0400
committerTravis Staton <hello@travisstaton.com>2014-09-16 12:10:55 -0400
commit0c2f42e50dbc86cacffc9c087e0a97c85c39b6c9 (patch)
tree9ce2b7fbe22c5d6e354f28de57e5d04fc19d5889 /src/Xmobar.hs
parenteb9f7a73677cc2bc872c3ea69f073faeefe6c989 (diff)
downloadxmobar-0c2f42e50dbc86cacffc9c087e0a97c85c39b6c9.tar.gz
xmobar-0c2f42e50dbc86cacffc9c087e0a97c85c39b6c9.tar.bz2
Add ability to set border width
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 6ea8fab..91245e2 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -296,7 +296,7 @@ drawInWin (Rectangle _ _ wid ht) ~[left,center,right] = do
printStrings p gc fs 1 R =<< strLn right
printStrings p gc fs 1 C =<< strLn center
-- draw 1 pixel border if requested
- io $ drawBorder (border c) d p gc bdcolor wid ht
+ io $ drawBorder (border c) (borderWidth c) d p gc bdcolor wid ht
-- copy the pixmap with the new string to the window
io $ copyArea d p w gc 0 0 wid ht 0 0
-- free up everything (we do not want to leak memory!)
@@ -315,9 +315,10 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do
Text t -> io $ textExtents fontst t
Icon _ -> return (0, 0)
let (conf,d) = (config &&& display) r
+ boffs = borderOffset (border conf) (borderWidth conf)
Rectangle _ _ wid ht = rect r
totSLen = foldr (\(_,_,len) -> (+) len) 0 sl
- valign = -1 + (fi ht + fi (as + ds)) `div` 2
+ valign = boffs-1 + (fi ht + fi (as + ds)) `div` 2
remWidth = fi wid - fi totSLen
offset = case a of
C -> (remWidth + offs) `div` 2