summaryrefslogtreecommitdiffhomepage
path: root/src/Xmobar.hs
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2012-09-09 01:24:35 +0200
committerJose Antonio Ortega Ruiz <jao@gnu.org>2012-09-09 01:24:35 +0200
commit157194dd20f252be1331e1eee579b8177b99d895 (patch)
tree30880ab7c4ef0d696b3192300126941c6876f5cc /src/Xmobar.hs
parent4d0504dfe6f6ad4a3ddd39e046a54864e6a306bc (diff)
downloadxmobar-157194dd20f252be1331e1eee579b8177b99d895.tar.gz
xmobar-157194dd20f252be1331e1eee579b8177b99d895.tar.bz2
Correct vertical alignment for XFT fonts
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r--src/Xmobar.hs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 9bec6bc..b58a961 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -262,7 +262,11 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do
let (conf,d) = (config &&& display) r
Rectangle _ _ wid ht = rect r
totSLen = foldr (\(_,_,len) -> (+) len) 0 sl
+#ifdef XFT
+ valign = (fi ht + fi (as + ds)) `div` 2
+#else
valign = (fi ht `div` 2) + (fi (as + ds) `div` 3)
+#endif
remWidth = fi wid - fi totSLen
offset = case a of
C -> (remWidth + offs) `div` 2