From 77fc3ca140d0b7cc1314437cb7b45fd897459550 Mon Sep 17 00:00:00 2001 From: Dmitry Kurochkin Date: Tue, 23 Oct 2007 18:54:30 +0200 Subject: Fix text vertical alignment. darcs-hash:20071023165430-903e8-c4c8b5aaae19225116f84a753cd57f902070dbbd.gz --- Xmobar.hs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Xmobar.hs') diff --git a/Xmobar.hs b/Xmobar.hs index 5e79009..864aa61 100644 --- a/Xmobar.hs +++ b/Xmobar.hs @@ -174,9 +174,9 @@ printStrings _ _ _ _ [] = return () printStrings dr gc fontst offs sl@((s,c,l):xs) = do r <- ask let (conf,d) = (config &&& display) r - (_,asc,_,_) = textExtents fontst s + (_,asc,dsc,_) = textExtents fontst s totSLen = foldr (\(_,_,len) -> (+) len) 0 sl - valign = (fi (height conf) + fi asc) `div` 2 + valign = (fi (height conf) + fi (asc) - fi dsc) `div` 2 remWidth = fi (width conf) - fi totSLen offset = case (align conf) of "center" -> (remWidth + offs) `div` 2 -- cgit v1.2.3