diff options
author | jao <jao@gnu.org> | 2014-12-30 01:12:28 +0100 |
---|---|---|
committer | jao <jao@gnu.org> | 2014-12-30 01:30:26 +0100 |
commit | f55fd96a34f9e59b56f8abb109c04dd120bf7161 (patch) | |
tree | 463c599d6e1338e8613b8a7c808151b11570db66 | |
parent | 584ff68d9ede856b36b75467b0ca2eb6d9e03ab4 (diff) | |
download | xmobar-f55fd96a34f9e59b56f8abb109c04dd120bf7161.tar.gz xmobar-f55fd96a34f9e59b56f8abb109c04dd120bf7161.tar.bz2 |
Linting and defaults
-rw-r--r-- | samples/xmobar.config | 1 | ||||
-rw-r--r-- | src/XUtil.hsc | 6 | ||||
-rw-r--r-- | src/Xmobar.hs | 4 |
3 files changed, 5 insertions, 6 deletions
diff --git a/samples/xmobar.config b/samples/xmobar.config index e1a1baa..c09ee7a 100644 --- a/samples/xmobar.config +++ b/samples/xmobar.config @@ -3,6 +3,7 @@ Config { font = "-misc-fixed-*-*-*-*-10-*-*-*-*-*-*-*" , border = TopB , bgColor = "black" , fgColor = "grey" + , alpha = 255 , position = Top , textOffset = -1 , iconOffset = -1 diff --git a/src/XUtil.hsc b/src/XUtil.hsc index e333a22..2e7e361 100644 --- a/src/XUtil.hsc +++ b/src/XUtil.hsc @@ -205,10 +205,8 @@ printString d p (Utf8 fs) gc fc bc x y s = io $ wcDrawImageString d p fs gc x y s #ifdef XFT -printString dpy drw fs@(Xft fonts) _ fc bc x y s = do - (a,d) <- textExtents fs s - gi <- xftTxtExtents' dpy fonts s - withDrawingColors dpy drw fc bc $ \draw -> \fc' -> \bc' -> +printString dpy drw (Xft fonts) _ fc bc x y s = do + withDrawingColors dpy drw fc bc $ \draw -> \fc' -> \_ -> (drawXftString' draw fc' fonts (toInteger x) (toInteger (y - 2)) s) #endif diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 069c7a6..900feaa 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -343,8 +343,8 @@ verticalOffset ht (Text t) fontst 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 + 1 + verticalMargin = fi ht - fi (as + ds) - 2 * fi (abs bwidth) + return $ fi ht - fi ds - (verticalMargin `div` 2) + bwidth + 1 verticalOffset _ (Icon _) _ conf | iconOffset conf > -1 = return $ fi (iconOffset conf) | otherwise = do |