From ba95216a359acea6a8e41e10d279dbaa85561084 Mon Sep 17 00:00:00 2001 From: Jose Antonio Ortega Ruiz Date: Mon, 10 Sep 2012 01:03:08 +0200 Subject: New module ColorCache --- src/Xmobar.hs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/Xmobar.hs') diff --git a/src/Xmobar.hs b/src/Xmobar.hs index de0de0a..3d17fad 100644 --- a/src/Xmobar.hs +++ b/src/Xmobar.hs @@ -49,6 +49,7 @@ import Runnable import Signal import Window import XUtil +import ColorCache #ifdef DBUS import IPC.DBus @@ -262,7 +263,7 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do let (conf,d) = (config &&& display) r Rectangle _ _ wid ht = rect r totSLen = foldr (\(_,_,len) -> (+) len) 0 sl - valign = ((fi ht + fi (as + ds)) `div` 2) - 1 + valign = -1 + (fi ht + fi (as + ds)) `div` 2 remWidth = fi wid - fi totSLen offset = case a of C -> (remWidth + offs) `div` 2 @@ -271,8 +272,5 @@ printStrings dr gc fontst offs a sl@((s,c,l):xs) = do (fc,bc) = case break (==',') c of (f,',':b) -> (f, b ) (f, _) -> (f, bgColor conf) - withColors d [bc] $ \[bc'] -> do - io $ setForeground d gc bc' - io $ fillRectangle d dr gc offset 0 (fi l) ht io $ printString d dr fontst gc fc bc offset valign s printStrings dr gc fontst (offs + l) a xs -- cgit v1.2.3