From 30f82a14f8183bade38090b3f3d1fd8463950201 Mon Sep 17 00:00:00 2001 From: Alexander Polakov Date: Mon, 4 Feb 2013 02:58:55 +0400 Subject: Use real icon width --- src/Bitmap.hs | 2 +- src/Xmobar.hs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Bitmap.hs b/src/Bitmap.hs index 9df2f67..a896626 100644 --- a/src/Bitmap.hs +++ b/src/Bitmap.hs @@ -13,7 +13,7 @@ module Bitmap ( updateCache , drawBitmap - , Bitmap) where + , Bitmap(..)) where import Control.Monad import Data.Map hiding (foldr, map, filter) diff --git a/src/Xmobar.hs b/src/Xmobar.hs index 04f0770..8ad82b2 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -239,8 +239,9 @@ drawInWin (Rectangle _ _ wid ht) ~[left,center,right] = do let (c,d ) = (config &&& display) r (w,fs) = (window &&& fontS ) r strLn = io . mapM getWidth + iconW i = maybe 0 Bitmap.width (lookup i $ iconS r) getWidth (Text s,cl) = textWidth d fs s >>= \tw -> return (Text s,cl,fi tw) - getWidth (Icon s,cl) = return (Icon s,cl,fi ht) + getWidth (Icon s,cl) = return (Icon s,cl,fi $ iconW s) withColors d [bgColor c, borderColor c] $ \[bgcolor, bdcolor] -> do gc <- io $ createGC d w -- cgit v1.2.3