summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2015-03-20 02:27:57 +0100
committerjao <jao@gnu.org>2015-03-20 02:27:57 +0100
commit90e6cd0407313858daef2eb6ecfd5cd04a2a72a8 (patch)
tree120b7fd7985217231615ce02a9f9391bc2d1baf3 /src/Xmobar.hs
parentbb406692011a78cb15414ec58e21487e927a597a (diff)
downloadxmobar-90e6cd0407313858daef2eb6ecfd5cd04a2a72a8.tar.gz
xmobar-90e6cd0407313858daef2eb6ecfd5cd04a2a72a8.tar.bz2
Fixes for vertical alignment and border drawing
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 12dc1de..680dd89 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -306,7 +306,7 @@ drawInWin wr@(Rectangle _ _ wid ht) ~[left,center,right] = do
printStrings p gc fs 1 L =<< strLn left
printStrings p gc fs 1 R =<< strLn right
printStrings p gc fs 1 C =<< strLn center
- -- draw 1 pixel border if requested
+ -- draw border if requested
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
@@ -322,9 +322,8 @@ verticalOffset ht (Text t) fontst conf
| textOffset conf > -1 = return $ fi (textOffset conf)
| otherwise = do
(as,ds) <- io $ textExtents fontst t
- let bwidth = borderOffset (border conf) (borderWidth conf)
- verticalMargin = fi ht - fi (as + ds) - 2 * fi (abs bwidth)
- return $ fi ht - fi ds - (verticalMargin `div` 2) + bwidth - 1
+ let margin = (fi ht - fi (as + ds)) `div` 2
+ return $ fi ht - margin - fi ds - 1
verticalOffset ht (Icon _) _ conf
| iconOffset conf > -1 = return $ fi (iconOffset conf)
| otherwise = return $ fi (ht `div` 2) - 1