summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2015-03-18 21:49:43 +0100
committerjao <jao@gnu.org>2015-03-18 21:49:43 +0100
commitc1d26d64926167e8d4b9ba2da181285141b23353 (patch)
tree66f7eec730794f3ae7bbc38b23682e725f337c54 /src/Xmobar.hs
parent17722c7b63ac878aede2ad80aac1267921d9a8dc (diff)
downloadxmobar-c1d26d64926167e8d4b9ba2da181285141b23353.tar.gz
xmobar-c1d26d64926167e8d4b9ba2da181285141b23353.tar.bz2
Fix for background's vertical aligment
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 08a6570..c3f32cb 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -316,15 +316,15 @@ drawInWin wr@(Rectangle _ _ wid ht) ~[left,center,right] = do
-- resync
io $ sync d True
-verticalOffset :: (Integral b, Integral a, MonadIO m) =>
- a -> Widget -> XFont -> Config -> m b
+verticalOffset :: (Integral b, Integral a, MonadIO m) =>
+ a -> Widget -> XFont -> Config -> m b
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 + 2
+ return $ fi ht - fi ds - (verticalMargin `div` 2) + bwidth
verticalOffset ht (Icon _) _ conf
| iconOffset conf > -1 = return $ fi (iconOffset conf)
| otherwise = return $ fi (ht `div` 2) - 1