diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 19:05:04 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 19:05:04 +0100 |
commit | 8624935317c768cfcc92173a3678afc67659e540 (patch) | |
tree | 6daab9d6d8aa1d7cbd23fa7933ad6c90f8386487 /XMonad/Layout | |
parent | 6cd7adf93fa8da770d9faa894e75694dd877a50a (diff) | |
download | XMonadContrib-8624935317c768cfcc92173a3678afc67659e540.tar.gz XMonadContrib-8624935317c768cfcc92173a3678afc67659e540.tar.xz XMonadContrib-8624935317c768cfcc92173a3678afc67659e540.zip |
ResizeScreen: add resizeHorizontalRight and resizeVerticalBottom
darcs-hash:20080218180504-32816-dc75b3ec16dce681aefe717b3c16e8cc200ccbb8.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/ResizeScreen.hs | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/XMonad/Layout/ResizeScreen.hs b/XMonad/Layout/ResizeScreen.hs index 4d7acff..54de481 100644 --- a/XMonad/Layout/ResizeScreen.hs +++ b/XMonad/Layout/ResizeScreen.hs @@ -18,8 +18,8 @@ module XMonad.Layout.ResizeScreen ( -- * Usage: -- $usage - resizeHorizontal - , resizeVertical + resizeHorizontal, resizeVertical + , resizeHorizontalRight, resizeVerticalBottom , withNewRectangle , ResizeScreen (..) ) where @@ -42,10 +42,16 @@ import XMonad.Layout.Decoration -- "XMonad.Doc.Extending#Editing_the_layout_hook" resizeHorizontal :: Int -> l a -> ModifiedLayout ResizeScreen l a -resizeHorizontal i = ModifiedLayout (ResizeScreen H i) +resizeHorizontal i = ModifiedLayout (ResizeScreen L i) resizeVertical :: Int -> l a -> ModifiedLayout ResizeScreen l a -resizeVertical i = ModifiedLayout (ResizeScreen V i) +resizeVertical i = ModifiedLayout (ResizeScreen T i) + +resizeHorizontalRight :: Int -> l a -> ModifiedLayout ResizeScreen l a +resizeHorizontalRight i = ModifiedLayout (ResizeScreen R i) + +resizeVerticalBottom :: Int -> l a -> ModifiedLayout ResizeScreen l a +resizeVerticalBottom i = ModifiedLayout (ResizeScreen B i) withNewRectangle :: Rectangle -> l a -> ModifiedLayout ResizeScreen l a withNewRectangle r = ModifiedLayout (WithNewScreen r) @@ -53,14 +59,17 @@ withNewRectangle r = ModifiedLayout (WithNewScreen r) data ResizeScreen a = ResizeScreen ResizeMode Int | WithNewScreen Rectangle deriving (Read, Show) -data ResizeMode = H | V deriving (Read, Show) + +data ResizeMode = T | B | L | R deriving (Read, Show) instance LayoutModifier ResizeScreen a where - modifyLayout m l re@(Rectangle x y w h) s - | ResizeScreen H i <- m = resize (Rectangle (x + fi i) y (w - fi i) h) - | ResizeScreen V i <- m = resize (Rectangle x (y + fi i) w (h - fi i)) + modifyLayout m l rect@(Rectangle x y w h) s + | ResizeScreen L i <- m = resize $ Rectangle (x + fi i) y (w - fi i) h + | ResizeScreen R i <- m = resize $ Rectangle x y (w - fi i) h + | ResizeScreen T i <- m = resize $ Rectangle x (y + fi i) w (h - fi i) + | ResizeScreen B i <- m = resize $ Rectangle x y w (h - fi i) | WithNewScreen r <- m = resize r - | otherwise = resize re + | otherwise = resize rect where resize nr = doLayout l nr s pureMess (ResizeScreen d _) m |