From 9bd59a251b768f87197f9f1a0618784b485353a7 Mon Sep 17 00:00:00 2001 From: Alexander Polakov Date: Sun, 3 Feb 2013 15:34:28 +0400 Subject: Better icon alignment --- src/Bitmap.hs | 2 +- src/Xmobar.hs | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Bitmap.hs b/src/Bitmap.hs index a896626..dfc1d04 100644 --- a/src/Bitmap.hs +++ b/src/Bitmap.hs @@ -65,4 +65,4 @@ drawBitmap d p gc fc bc x y i = h = height i setForeground d gc fc' setBackground d gc bc' - copyPlane d (pixmap i) p gc 0 0 w h x (y - fromIntegral h) 1 + copyPlane d (pixmap i) p gc 0 0 w h x (1 + y - fromIntegral h `div` 2) 1 diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 8ad82b2..67badaa 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -271,9 +271,9 @@ printStrings :: Drawable -> GC -> XFont -> Position printStrings _ _ _ _ _ [] = return () printStrings dr gc fontst offs a sl@((s,c,l):xs) = do r <- ask - let fromWidget (Text t) = t - fromWidget (Icon t) = t - (as,ds) <- io $ textExtents fontst (fromWidget s) + (as,ds) <- case s of + Text t -> io $ textExtents fontst t + Icon _ -> return (0, 0) let (conf,d) = (config &&& display) r Rectangle _ _ wid ht = rect r totSLen = foldr (\(_,_,len) -> (+) len) 0 sl -- cgit v1.2.3