add pureMessage.

This commit is contained in:
David Roundy
2007-10-05 14:05:53 +00:00
parent 1f9e77bd90
commit 6294e6adf5
2 changed files with 5 additions and 4 deletions

View File

@@ -423,9 +423,8 @@ instance LayoutClass Tall a where
doLayout (Tall nmaster _ frac) r =
return . (\x->(x,Nothing)) .
ap zip (tile frac r nmaster . length) . W.integrate
handleMessage (Tall nmaster delta frac) m =
return $ msum [fmap resize (fromMessage m)
,fmap incmastern (fromMessage m)]
pureMessage (Tall nmaster delta frac) m = 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)
incmastern (IncMasterN d) = Tall (max 0 (nmaster+d)) delta frac