summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 22:36:22 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 22:36:22 +0200
commitb85876bdae0c61c2e69ab5e9b38ad01a8f7968a3 (patch)
tree32205d44a94b2ff7c0fe76d0c397fb855af9a6b7
parent6b00949f9cc618322785f5214da477769718cac5 (diff)
downloadmetatile-b85876bdae0c61c2e69ab5e9b38ad01a8f7968a3.tar
metatile-b85876bdae0c61c2e69ab5e9b38ad01a8f7968a3.zip
Remove obsolete 'layout' function
darcs-hash:20070611203622-a5988-137014b9de3456eb1d3f7f722518fe6afcbca322
-rw-r--r--Operations.hs20
1 files changed, 6 insertions, 14 deletions
diff --git a/Operations.hs b/Operations.hs
index d5a9370..fb6c788 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -333,7 +333,12 @@ setFocusX w = withWindowSet $ \ws -> do
-- uppermost.
--
switchLayout :: X ()
-switchLayout = layout (\(x, xs) -> let xs' = xs ++ [x] in (head xs', tail xs'))
+switchLayout = do
+ sendMessage ModifyWindows
+ n <- gets (W.tag . W.workspace . W.current . windowset)
+ modify $ \s -> s { layouts = M.adjust switch n (layouts s) }
+ refresh
+ where switch (x, xs) = let xs' = xs ++ [x] in (head xs', tail xs')
-- | Throw a message to the current Layout possibly modifying how we
-- layout the windows, then refresh.
@@ -435,19 +440,6 @@ splitHorizontallyBy f (Rectangle sx sy sw sh) =
splitVerticallyBy f = (mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirrorRect
------------------------------------------------------------------------
-
--- | layout. Modify the current workspace's layout with a pure
--- function and refresh.
-layout :: ((Layout, [Layout]) -> (Layout, [Layout])) -> X ()
-layout f = do
- sendMessage ModifyWindows
- modify $ \s ->
- let n = W.tag . W.workspace . W.current . windowset $ s
- (Just fl) = M.lookup n $ layouts s
- in s { layouts = M.insert n (f fl) (layouts s) }
- refresh
-
-------------------------------------------------------------------------
-- Utilities
-- | Return workspace visible on screen 'sc', or 0.