diff options
author | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-09-10 01:03:08 +0200 |
---|---|---|
committer | Jose Antonio Ortega Ruiz <jao@gnu.org> | 2012-09-10 01:03:08 +0200 |
commit | ba95216a359acea6a8e41e10d279dbaa85561084 (patch) | |
tree | a94aae2f63ebb000cb0d5e339640e5f801dec158 /src/Xmobar.hs | |
parent | 67e0c9f540cde8c837d125cb9ba59f433460dd4d (diff) | |
download | xmobar-ba95216a359acea6a8e41e10d279dbaa85561084.tar.gz xmobar-ba95216a359acea6a8e41e10d279dbaa85561084.tar.bz2 |
New module ColorCache
Diffstat (limited to 'src/Xmobar.hs')
-rw-r--r-- | src/Xmobar.hs | 6 |
1 files changed, 2 insertions, 4 deletions
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 |