summaryrefslogtreecommitdiffstats
path: root/Operations.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-14 23:59:59 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-14 23:59:59 +0200
commit6ba134c9e54d42c189d60a924c27921739b7c197 (patch)
tree36a2db2018d52bf48ec4b3649f3bc1b5e15f772f /Operations.hs
parenta576ec8b32e15da3068518c867c92f208cdac293 (diff)
downloadmetatile-6ba134c9e54d42c189d60a924c27921739b7c197.tar
metatile-6ba134c9e54d42c189d60a924c27921739b7c197.zip
move Layout stuff into class (hokey first cut).
darcs-hash:20070914215959-72aca-3feae03a6560a70908ad37d28f47c8d47321008e
Diffstat (limited to 'Operations.hs')
-rw-r--r--Operations.hs24
1 files changed, 12 insertions, 12 deletions
diff --git a/Operations.hs b/Operations.hs
index f2a6be7..bc939ac 100644
--- a/Operations.hs
+++ b/Operations.hs
@@ -138,7 +138,7 @@ windows f = do
-- just the tiled windows:
-- now tile the windows on this workspace, modified by the gap
- (rs, ml') <- runLayout l viewrect tiled `catchX` runLayout full viewrect tiled
+ (rs, ml') <- runLayout l viewrect tiled `catchX` runLayout (SomeLayout full) viewrect tiled
mapM_ (uncurry tileWindow) rs
whenJust ml' $ \l' -> modify $ \ss ->
ss { layouts = M.adjust (first (const l')) n (layouts ss) }
@@ -351,19 +351,19 @@ instance Message IncMasterN
-- simple fullscreen mode, just render all windows fullscreen.
-- a plea for tuple sections: map . (,sc)
-full :: Layout a
-full = Layout { doLayout = \sc (W.Stack f _ _) -> return ([(f, sc)],Nothing)
- , modifyLayout = const (return Nothing) } -- no changes
+full :: OldLayout a
+full = OldLayout { doLayout' = \sc (W.Stack f _ _) -> return ([(f, sc)],Nothing)
+ , modifyLayout' = const (return Nothing) } -- no changes
--
-- The tiling mode of xmonad, and its operations.
--
-tall :: Int -> Rational -> Rational -> Layout a
+tall :: Int -> Rational -> Rational -> OldLayout a
tall nmaster delta frac =
- Layout { doLayout = \r -> return . (\x->(x,Nothing)) .
+ OldLayout { doLayout' = \r -> return . (\x->(x,Nothing)) .
ap zip (tile frac r nmaster . length) . W.integrate
- , modifyLayout = \m -> return $ msum [fmap resize (fromMessage m)
- ,fmap incmastern (fromMessage m)] }
+ , modifyLayout' = \m -> return $ msum [fmap resize (fromMessage m)
+ ,fmap incmastern (fromMessage m)] }
where resize Shrink = tall nmaster delta (max 0 $ frac-delta)
resize Expand = tall nmaster delta (min 1 $ frac+delta)
@@ -374,11 +374,11 @@ mirrorRect :: Rectangle -> Rectangle
mirrorRect (Rectangle rx ry rw rh) = (Rectangle ry rx rh rw)
-- | Mirror a layout, compute its 90 degree rotated form.
-mirror :: Layout a -> Layout a
-mirror (Layout { doLayout = dl, modifyLayout = ml }) =
- Layout { doLayout = \sc w -> do (wrs, ml') <- dl (mirrorRect sc) w
+mirror :: Layout l a => l a -> OldLayout a
+mirror l =
+ OldLayout { doLayout' = \sc w -> do (wrs, ml') <- doLayout l (mirrorRect sc) w
return (map (second mirrorRect) wrs, mirror `fmap` ml')
- , modifyLayout = fmap (fmap mirror) . ml }
+ , modifyLayout' = fmap (fmap mirror) . modifyLayout l }
-- | tile. Compute the positions for windows using the default 2 pane tiling algorithm.
--