make Accordian use pureLayout.

This commit is contained in:
David Roundy
2007-09-25 19:21:17 +00:00
parent 23af4f228b
commit c2ca3c6593

View File

@@ -33,14 +33,9 @@ import Data.Ratio
data Accordion a = Accordion deriving ( Read, Show )
instance Layout Accordion Window where
doLayout _ = accordionLayout
accordionLayout :: Eq a => Rectangle -> W.Stack a -> X ([(a, Rectangle)], Maybe (Accordion a))
accordionLayout sc ws = return ((zip ups tops) ++
[(W.focus ws, mainPane)] ++
(zip dns bottoms)
,Nothing)
where ups = W.up ws
pureLayout _ sc ws = zip ups tops ++ [(W.focus ws, mainPane)] ++ zip dns bottoms
where
ups = W.up ws
dns = W.down ws
(top, allButTop) = splitVerticallyBy (1%8 :: Ratio Int) sc
(center, bottom) = splitVerticallyBy (6%7 :: Ratio Int) allButTop