From ec614439821045141fe4bbd40329cbca17780785 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sat, 23 Jun 2007 16:35:42 +0200 Subject: introduce idModify which is just "const (return Nothing)". darcs-hash:20070623143542-72aca-b1bc6ffaf524ee9c1f4ac7e04d8224e02bba0b1b.gz --- LayoutHelpers.hs | 5 ++++- Square.hs | 7 ++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/LayoutHelpers.hs b/LayoutHelpers.hs index e134deb..86cd295 100644 --- a/LayoutHelpers.hs +++ b/LayoutHelpers.hs @@ -16,7 +16,7 @@ module XMonadContrib.LayoutHelpers ( -- $usage DoLayout, ModDo, ModMod, ModLay, layoutModify, - l2lModDo, + l2lModDo, idModify, idModMod, ) 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) +idModify :: ModifyLayout a +idModify _ = return Nothing + idModMod :: ModMod a idModMod _ = return Nothing diff --git a/Square.hs b/Square.hs index 4da5130..389b2f2 100644 --- a/Square.hs +++ b/Square.hs @@ -40,8 +40,13 @@ import XMonadContrib.LayoutHelpers ( l2lModDo ) -- > ,(combo [(twoPane 0.03 0.8,1),(square,1)] -- > (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 { doLayout = l2lModDo arrange, modifyLayout = const (return Nothing) } +square = Layout { doLayout = l2lModDo arrange, modifyLayout = idModify } where arrange :: Rectangle -> [a] -> [(a, Rectangle)] arrange rect ws@(_:_) = map (\w->(w,rest)) (init ws) ++ [(last ws,sq)] where (rest, sq) = splitSquare rect -- cgit v1.2.3