summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-09 02:12:03 +0200
committerAndrea Rossato <andrea.rossato@ing.unitn.it>2007-07-09 02:12:03 +0200
commit899a2c3a6950dc5acfca2c532cac0086fb098b0b (patch)
treedce3eb4f99d59766339353d08b1a1efa37634415
parent7fe909257403714f6f6b24afbdce30e29c5605bf (diff)
downloadxmobar-899a2c3a6950dc5acfca2c532cac0086fb098b0b.tar.gz
xmobar-899a2c3a6950dc5acfca2c532cac0086fb098b0b.tar.bz2
comments only
darcs-hash:20070709001203-d6583-885a1e12b59937b9e4c8543d13edb7281f91ea81.gz
-rw-r--r--XMobar.hs13
1 files changed, 7 insertions, 6 deletions
diff --git a/XMobar.hs b/XMobar.hs
index 0c9b65c..6e9b142 100644
--- a/XMobar.hs
+++ b/XMobar.hs
@@ -111,19 +111,20 @@ drawInWin str =
--let's get the fonts
fontst <- io $ loadQueryFont dpy (font config)
io $ setFont dpy gc (fontFromFontStruct fontst)
- -- create a pixmap to write to and fill it with a rectangle:
+ -- create a pixmap to write to and fill it with a rectangle
p <- io $ createPixmap dpy win
(fi (width config))
(fi (height config))
- (defaultDepthOfScreen (defaultScreenOfDisplay dpy))
+ (defaultDepthOfScreen (defaultScreenOfDisplay dpy))
+ -- the fgcolor of the rectangle will be the bgcolor of the window
io $ setForeground dpy gc bgcolor
io $ fillRectangle dpy p gc 0 0
(fi $ width config)
(fi $ height config)
- -- write to the pixmap the new string:
+ -- write to the pixmap the new string
let strWithLenth = map (\(s,c) -> (s,c,textWidth fontst s)) str
p' <- printStrings p gc fontst 1 strWithLenth
- -- copy the pixmap with the new string to the window.
+ -- copy the pixmap with the new string to the window
io $ copyArea dpy p' win gc 0 0 (fi (width config)) (fi (height config)) 0 0
-- free up everything (we do not want to leak memory!)
io $ freeFont dpy fontst
@@ -138,8 +139,8 @@ printStrings :: Drawable
-> FontStruct
-> Position
-> [(String, String, Position)]
- -> Xbar Pixmap --()
-printStrings p _ _ _ [] = return p --()
+ -> Xbar Pixmap
+printStrings p _ _ _ [] = return p
printStrings p gc fontst offs sl@((s,c,l):xs) =
do config <- ask
st <- get