From 208ecb56790ee6cd372cf340c0b22d7b5fe1d2ad Mon Sep 17 00:00:00 2001 From: jao Date: Wed, 11 Mar 2015 18:15:53 +0100 Subject: Fix for default icon vertical alignment (#216) --- src/Xmobar.hs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 36f6cbb..1963ba2 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -202,7 +202,7 @@ eventLoop tv xc@(XConf d r w fs is cfg) as signal = do eventLoop tv xc as signal reposWindow rcfg = do - r' <- repositionWin d w (fs!!0) rcfg + r' <- repositionWin d w (head fs) rcfg eventLoop tv (XConf d r' w fs is rcfg) as signal updateConfigPosition ocfg = @@ -325,11 +325,9 @@ verticalOffset ht (Text t) fontst conf 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 -verticalOffset _ (Icon _) _ conf +verticalOffset ht (Icon _) _ conf | iconOffset conf > -1 = return $ fi (iconOffset conf) - | otherwise = do - let bwidth = borderOffset (border conf) (borderWidth conf) - return $ bwidth + 1 + | otherwise = return $ fi (ht `div` 2) -- | An easy way to print the stuff we need to print printStrings :: Drawable -> GC -> [XFont] -> Position -- cgit v1.2.3