summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorDmitry Malikov <color404051h@gmail.com>2013-01-20 02:01:10 +0400
committerDmitry Malikov <color404051h@gmail.com>2013-01-20 02:01:10 +0400
commitde224f0ead3c76d6dca4c72fd6c4def15ca858bc (patch)
treece0976ccd0f2c54e9804e57505471ccccdde8b3c /src
parent8498b6e21054b424b4ded7bd01b02a0c31eb4209 (diff)
downloadxmobar-de224f0ead3c76d6dca4c72fd6c4def15ca858bc.tar.gz
xmobar-de224f0ead3c76d6dca4c72fd6c4def15ca858bc.tar.bz2
New XPositions: TopP and BottomP
Diffstat (limited to 'src')
-rw-r--r--src/Config.hs3
-rw-r--r--src/Window.hs4
2 files changed, 7 insertions, 0 deletions
diff --git a/src/Config.hs b/src/Config.hs
index 622c79c..6ab3f8d 100644
--- a/src/Config.hs
+++ b/src/Config.hs
@@ -23,6 +23,7 @@ module Config
, runnableTypes
) where
+
import Commands
import {-# SOURCE #-} Runnable
import Plugins.Monitors
@@ -73,7 +74,9 @@ data Config =
data XPosition = Top
| TopW Align Int
| TopSize Align Int Int
+ | TopP Int Int
| Bottom
+ | BottomP Int Int
| BottomW Align Int
| BottomSize Align Int Int
| Static {xpos, ypos, width, height :: Int}
diff --git a/src/Window.hs b/src/Window.hs
index e9a67cf..f43fe4b 100644
--- a/src/Window.hs
+++ b/src/Window.hs
@@ -59,10 +59,12 @@ setPosition :: XPosition -> [Rectangle] -> Dimension -> (Rectangle,Bool)
setPosition p rs ht =
case p' of
Top -> (Rectangle rx ry rw h, True)
+ TopP l r -> (Rectangle (rx + fi l) ry (rw - fi l - fi r) 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)
+ BottomP l r -> (Rectangle (rx + fi l) ny (rw - fi l - fi r) 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
@@ -115,9 +117,11 @@ getStrutValues r@(Rectangle x y w h) p rwh =
case p of
OnScreen _ p' -> getStrutValues r p' rwh
Top -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
+ TopP _ _ -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
TopW _ _ -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
TopSize {} -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
Bottom -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
+ BottomP _ _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
BottomW _ _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
BottomSize {} -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
Static {} -> getStaticStrutValues p rwh