mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
XMonad.Actions.Plane.Linear
This commit is contained in:
@@ -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"
|
||||
|
Reference in New Issue
Block a user