From fecca6037b57d3d1d19c050ac529aac2a6461c6d Mon Sep 17 00:00:00 2001 From: leoserra Date: Sun, 6 Jul 2008 19:53:03 +0200 Subject: XMonad.Actions.Plane.Linear darcs-hash:20080706175303-3225b-c65a1f082dd8dc9866fb6a6d2ce5e6abd525c571.gz --- XMonad/Actions/Plane.hs | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) (limited to 'XMonad/Actions/Plane.hs') diff --git a/XMonad/Actions/Plane.hs b/XMonad/Actions/Plane.hs index 7e65117..9dca7d2 100644 --- a/XMonad/Actions/Plane.hs +++ b/XMonad/Actions/Plane.hs @@ -71,6 +71,7 @@ data Limits -- to the next region. | Circular -- ^ If you try to move, you'll get to the other edge, on the -- other side. + | Linear -- ^ The plan comes as a row. deriving Eq -- | The number of lines in which the workspaces will be arranged. It's @@ -137,6 +138,9 @@ plane function numberLines_ limits direction = do return 1 let + notBorder :: Bool + notBorder = (replicate 2 (circular_ < currentWS) ++ replicate 2 (circular_ > currentWS)) !! fromEnum direction + circular_ :: Int circular_ = circular currentWS @@ -149,6 +153,15 @@ plane function numberLines_ limits direction = do ] !! fromEnum direction + linear :: Int -> Int + linear = + [ onLine pred . onColumn pred + , onColumn pred . onLine pred + , onLine succ . onColumn succ + , onColumn succ . onLine succ + ] + !! fromEnum direction + onLine :: (Int -> Int) -> Int -> Int onLine f currentWS_ | line < areasLine = mod_ columns @@ -211,12 +224,9 @@ plane function numberLines_ limits direction = do when (isJust mCurrentWS) $ case limits of - Finite -> - when ((replicate 2 (circular_ < currentWS) ++ replicate 2 (circular_ > currentWS)) !! fromEnum direction) - $ run circular - - Circular -> - run circular + Finite -> when notBorder $ run circular + Circular -> run circular + Linear -> if notBorder then run circular else run linear gconftool :: String gconftool = "gconftool-2" -- cgit v1.2.3