summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorKostas Agnantis <kagnadis@gmail.com>2022-10-27 01:21:25 +0300
committerKostas Agnantis <kagnadis@gmail.com>2022-11-06 23:43:46 +0200
commit0554a448bb27985e8d66940d077f54eda58d8e5a (patch)
tree375d548623dad7dc420c5d6de1185689c43384bb
parentfa38f5dd3d31bf54a2105bf341e247376b8e9422 (diff)
downloadxmobar-0554a448bb27985e8d66940d077f54eda58d8e5a.tar.gz
xmobar-0554a448bb27985e8d66940d077f54eda58d8e5a.tar.bz2
Adds new position configuration
- TopHM: Top position with left/right/top margins and specific height - BottomHM: Bottom position with left/right/bottom margins and specific height
-rw-r--r--src/Xmobar/Config/Types.hs2
-rw-r--r--src/Xmobar/X11/Window.hs4
2 files changed, 6 insertions, 0 deletions
diff --git a/src/Xmobar/Config/Types.hs b/src/Xmobar/Config/Types.hs
index df39f6d..1172034 100644
--- a/src/Xmobar/Config/Types.hs
+++ b/src/Xmobar/Config/Types.hs
@@ -89,11 +89,13 @@ data Config =
data XPosition = Top
| TopH Int
+ | TopHM Int Int Int Int -- left right top height
| TopW Align Int
| TopSize Align Int Int
| TopP Int Int
| Bottom
| BottomH Int
+ | BottomHM Int Int Int Int -- left right bottom height
| BottomP Int Int
| BottomW Align Int
| BottomSize Align Int Int
diff --git a/src/Xmobar/X11/Window.hs b/src/Xmobar/X11/Window.hs
index ad7ebf7..61d701e 100644
--- a/src/Xmobar/X11/Window.hs
+++ b/src/Xmobar/X11/Window.hs
@@ -86,10 +86,12 @@ setPosition c p rs ht =
T.Top -> X.Rectangle rx ry rw h
T.TopP l r -> X.Rectangle (rx + fi l) ry (rw - fi l - fi r) h
T.TopH ch -> X.Rectangle rx ry rw (mh ch)
+ T.TopHM l r t ch -> X.Rectangle (rx + fi l) (ry + fi t) (rw - fi l - fi r) (mh ch)
T.TopW a i -> X.Rectangle (ax a i) ry (nw i) h
T.TopSize a i ch -> X.Rectangle (ax a i) ry (nw i) (mh ch)
T.Bottom -> X.Rectangle rx ny rw h
T.BottomH ch -> X.Rectangle rx (ny' ch) rw (mh ch)
+ T.BottomHM l r b ch -> X.Rectangle (rx + fi l) (ry + fi rh - fi b - fi (mh ch)) (rw - fi l - fi r) (mh ch)
T.BottomW a i -> X.Rectangle (ax a i) ny (nw i) h
T.BottomP l r -> X.Rectangle (rx + fi l) ny (rw - fi l - fi r) h
T.BottomSize a i ch -> X.Rectangle (ax a i) (ny' ch) (nw i) (mh ch)
@@ -163,11 +165,13 @@ getStrutValues r@(X.Rectangle x y w h) p rwh =
T.OnScreen _ p' -> getStrutValues r p' rwh
T.Top -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
T.TopH _ -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
+ T.TopHM {} -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
T.TopP _ _ -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
T.TopW _ _ -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
T.TopSize {} -> [0, 0, st, 0, 0, 0, 0, 0, nx, nw, 0, 0]
T.Bottom -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
T.BottomH _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
+ T.BottomHM {} -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
T.BottomP _ _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
T.BottomW _ _ -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]
T.BottomSize {} -> [0, 0, 0, sb, 0, 0, 0, 0, 0, 0, nx, nw]