introduce idModify which is just "const (return Nothing)".

This commit is contained in:
David Roundy 2007-06-23 14:35:42 +00:00
parent 23c8610798
commit 62a7deafd3
2 changed files with 10 additions and 2 deletions

View File

@ -16,7 +16,7 @@ module XMonadContrib.LayoutHelpers (
-- $usage -- $usage
DoLayout, ModDo, ModMod, ModLay, DoLayout, ModDo, ModMod, ModLay,
layoutModify, layoutModify,
l2lModDo, l2lModDo, idModify,
idModMod, idModMod,
) where ) where
@ -58,5 +58,8 @@ l2lModDo :: (Rectangle -> [a] -> [(a,Rectangle)]) -> DoLayout a
--l2lModDo dl r s = return (dl r $ integrate s, Nothing) --l2lModDo dl r s = return (dl r $ integrate s, Nothing)
l2lModDo dl r s = return (dl r $ integrate s) l2lModDo dl r s = return (dl r $ integrate s)
idModify :: ModifyLayout a
idModify _ = return Nothing
idModMod :: ModMod a idModMod :: ModMod a
idModMod _ = return Nothing idModMod _ = return Nothing

View File

@ -40,8 +40,13 @@ import XMonadContrib.LayoutHelpers ( l2lModDo )
-- > ,(combo [(twoPane 0.03 0.8,1),(square,1)] -- > ,(combo [(twoPane 0.03 0.8,1),(square,1)]
-- > (mirror $ twoPane 0.03 0.85),1)] (twoPane 0.03 0.5) ) -- > (mirror $ twoPane 0.03 0.85),1)] (twoPane 0.03 0.5) )
import XMonad
import Graphics.X11.Xlib
import StackSet ( integrate )
import XMonadContrib.LayoutHelpers ( l2lModDo )
square :: Layout a square :: Layout a
square = Layout { doLayout = l2lModDo arrange, modifyLayout = const (return Nothing) } square = Layout { doLayout = l2lModDo arrange, modifyLayout = idModify }
where arrange :: Rectangle -> [a] -> [(a, Rectangle)] where arrange :: Rectangle -> [a] -> [(a, Rectangle)]
arrange rect ws@(_:_) = map (\w->(w,rest)) (init ws) ++ [(last ws,sq)] arrange rect ws@(_:_) = map (\w->(w,rest)) (init ws) ++ [(last ws,sq)]
where (rest, sq) = splitSquare rect where (rest, sq) = splitSquare rect