diff options
author | tv <tv@krebsco.de> | 2016-02-12 14:17:49 +0100 |
---|---|---|
committer | tv <tv@krebsco.de> | 2016-02-12 14:17:49 +0100 |
commit | 179d29fd4c765dee698058ef63295331ac603639 (patch) | |
tree | d3ccc2963bcaeffc3fda2cf661c636e91903e8d5 /XMonad/Stockholm/Font.hs | |
parent | 2dbefe42fc5cfe9093465bf3e22ba8f82feeef6e (diff) |
Diffstat (limited to 'XMonad/Stockholm/Font.hs')
-rw-r--r-- | XMonad/Stockholm/Font.hs | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/XMonad/Stockholm/Font.hs b/XMonad/Stockholm/Font.hs index b30a1e7..ed801cc 100644 --- a/XMonad/Stockholm/Font.hs +++ b/XMonad/Stockholm/Font.hs @@ -22,8 +22,8 @@ printStringCentered d p xmf gc r s = do text_w <- textWidthXMF d xmf s (text_ascent, _) <- textExtentsXMF xmf s - let text_x = x + round ((fi w - fi text_w) / 2) - text_y = y + round ((fi h + fi text_h) / 2) + let text_x = x + round ((fi w - fi text_w) / (2 :: Double)) + text_y = y + round ((fi h + fi text_h) / (2 :: Double)) text_h = text_ascent printStringXMF' d p xmf gc "" "" text_x text_y s @@ -32,13 +32,13 @@ printStringCentered d p xmf gc r s = do -- from xmonad-contrib's XMonad.Util.Font, (c) 2007 Andrea Rossato and Spencer Janssen printStringXMF' :: (Functor m, MonadIO m) => Display -> Drawable -> XMonadFont -> GC -> String -> String -> Position -> Position -> String -> m () -printStringXMF' d p (Core fs) gc fc bc x y s = io $ do +printStringXMF' d p (Core fs) gc _fc _bc x y s = io $ do setFont d gc $ fontFromFontStruct fs --tv [fc',bc'] <- mapM (stringToPixel d) [fc,bc] --tv setForeground d gc fc' --tv setBackground d gc bc' drawImageString d p gc x y s -printStringXMF' d p (Utf8 fs) gc fc bc x y s = io $ do +printStringXMF' d p (Utf8 fs) gc _fc _bc x y s = io $ do --tv [fc',bc'] <- mapM (stringToPixel d) [fc,bc] --tv setForeground d gc fc' --tv setBackground d gc bc' @@ -59,6 +59,8 @@ printStringXMF' dpy drw fs@(Xft font) gc fc bc x y s = do io $ withXftDraw dpy drw visual colormap $ \draw -> withXftColorName dpy visual colormap fc $ \color -> xftDrawString draw color font x y s +#else +printStringXMF' _ _ (Xft _) _ _ _ _ _ _ = undefined #endif |