summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-27 02:18:43 +0100
committerJose Antonio Ortega Ruiz <jao@gnu.org>2010-12-27 02:18:43 +0100
commit729359d2b442030da0d033e3ec7bfae603c39116 (patch)
tree619330e532c943ffe6c7554e9b57d59abe10a6a3
parent73d2eacb856a8beb2133ff9584a209d36ed34467 (diff)
downloadxmobar-729359d2b442030da0d033e3ec7bfae603c39116.tar.gz
xmobar-729359d2b442030da0d033e3ec7bfae603c39116.tar.bz2
Respect height in BottomSize (issue 27)
-rw-r--r--src/Xmobar.hs52
1 files changed, 26 insertions, 26 deletions
diff --git a/src/Xmobar.hs b/src/Xmobar.hs
index 2f5aa3c..2f5af19 100644
--- a/src/Xmobar.hs
+++ b/src/Xmobar.hs
@@ -145,32 +145,32 @@ createWin d fs c = do
setPosition :: XPosition -> [Rectangle] -> Dimension -> (Rectangle,Bool)
setPosition p rs ht =
- case p' of
- Top -> (Rectangle rx ry rw h , True)
- TopW a i -> (Rectangle (ax a i ) ry (nw i ) h , True)
- TopSize a i ch -> (Rectangle (ax a i ) ry (nw i ) (mh ch), True)
- Bottom -> (Rectangle rx ny rw h , True)
- BottomW a i -> (Rectangle (ax a i ) ny (nw i ) h , True)
- BottomSize a i ch -> (Rectangle (ax a i ) ny (nw i ) (mh ch), True)
- Static cx cy cw ch -> (Rectangle (fi cx ) (fi cy) (fi cw) (fi ch), True)
- OnScreen _ p'' -> setPosition p'' [scr] ht
- where
- (scr@(Rectangle rx ry rw rh), p') =
- case p of OnScreen i x -> (fromMaybe (head rs) $ safeIndex i rs, x)
- _ -> (head rs, p)
- ny = ry + fi (rh - ht)
- center i = rx + (fi $ div (remwid i) 2)
- right i = rx + (fi $ remwid i)
- remwid i = rw - pw (fi i)
- ax L = const rx
- ax R = right
- ax C = center
- pw i = rw * (min 100 i) `div` 100
- nw = fi . pw . fi
- h = fi ht
- mh h' = max (fi h') h
-
- safeIndex i = lookup i . zip [0..]
+ case p' of
+ Top -> (Rectangle rx ry rw h, True)
+ TopW a i -> (Rectangle (ax a i) ry (nw i) h, True)
+ TopSize a i ch -> (Rectangle (ax a i) ry (nw i) (mh ch), True)
+ Bottom -> (Rectangle rx ny rw h, True)
+ BottomW a i -> (Rectangle (ax a i) ny (nw i) h, True)
+ BottomSize a i ch -> (Rectangle (ax a i) (ny' ch) (nw i) (mh ch), True)
+ Static cx cy cw ch -> (Rectangle (fi cx) (fi cy) (fi cw) (fi ch), True)
+ OnScreen _ p'' -> setPosition p'' [scr] ht
+ where
+ (scr@(Rectangle rx ry rw rh), p') =
+ case p of OnScreen i x -> (fromMaybe (head rs) $ safeIndex i rs, x)
+ _ -> (head rs, p)
+ ny = ry + fi (rh - ht)
+ center i = rx + (fi $ div (remwid i) 2)
+ right i = rx + (fi $ remwid i)
+ remwid i = rw - pw (fi i)
+ ax L = const rx
+ ax R = right
+ ax C = center
+ pw i = rw * (min 100 i) `div` 100
+ nw = fi . pw . fi
+ h = fi ht
+ mh h' = max (fi h') h
+ ny' h' = ry + fi (rh - mh h')
+ safeIndex i = lookup i . zip [0..]
setProperties :: Rectangle -> Config -> Display -> Window -> [Rectangle] -> IO ()
setProperties r c d w srs = do