diff options
author | Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com> | 2007-07-06 04:48:14 +0200 |
---|---|---|
committer | Krzysztof Kosciuszkiewicz <k.kosciuszkiewicz@gmail.com> | 2007-07-06 04:48:14 +0200 |
commit | 0b11566a389e54b4c5d891def5641a1dad7098a5 (patch) | |
tree | fe4a32e982a15e2fecc0e10e6b8ebcc5a73d7c9a | |
parent | 4025caa168743fd5cd1cd77046e3b99c79ced38b (diff) | |
download | xmobar-0b11566a389e54b4c5d891def5641a1dad7098a5.tar.gz xmobar-0b11566a389e54b4c5d891def5641a1dad7098a5.tar.bz2 |
Fix centered text align.
darcs-hash:20070706024814-ba08c-f6e828e21a3d20af358819e3cb6a13c29a4ff28e.gz
-rw-r--r-- | XMobar.hs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -142,9 +142,10 @@ printStrings gc fontst offs sl@((s,c,l):xs) = let (_,asc,_,_) = textExtents fontst s totSLen = foldr (\(_,_,len) -> (+) len) 0 sl valign = (fromIntegral (height config) + fromIntegral asc) `div` 2 + remWidth = fromIntegral (width config) - fromIntegral totSLen offset = case (align config) of - "center" -> (fromIntegral (width config) - fromIntegral totSLen) `div` 2 - "right" -> fromIntegral (width config) - fromIntegral totSLen - 1 + "center" -> (remWidth + offs) `div` 2 + "right" -> remWidth - 1 "left" -> offs _ -> offs color <- io $ initColor (display st) c |