mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-03 21:51:52 -07:00
make Accordian use pureLayout.
This commit is contained in:
11
Accordion.hs
11
Accordion.hs
@@ -33,14 +33,9 @@ import Data.Ratio
|
|||||||
data Accordion a = Accordion deriving ( Read, Show )
|
data Accordion a = Accordion deriving ( Read, Show )
|
||||||
|
|
||||||
instance Layout Accordion Window where
|
instance Layout Accordion Window where
|
||||||
doLayout _ = accordionLayout
|
pureLayout _ sc ws = zip ups tops ++ [(W.focus ws, mainPane)] ++ zip dns bottoms
|
||||||
|
where
|
||||||
accordionLayout :: Eq a => Rectangle -> W.Stack a -> X ([(a, Rectangle)], Maybe (Accordion a))
|
ups = W.up ws
|
||||||
accordionLayout sc ws = return ((zip ups tops) ++
|
|
||||||
[(W.focus ws, mainPane)] ++
|
|
||||||
(zip dns bottoms)
|
|
||||||
,Nothing)
|
|
||||||
where ups = W.up ws
|
|
||||||
dns = W.down ws
|
dns = W.down ws
|
||||||
(top, allButTop) = splitVerticallyBy (1%8 :: Ratio Int) sc
|
(top, allButTop) = splitVerticallyBy (1%8 :: Ratio Int) sc
|
||||||
(center, bottom) = splitVerticallyBy (6%7 :: Ratio Int) allButTop
|
(center, bottom) = splitVerticallyBy (6%7 :: Ratio Int) allButTop
|
||||||
|
Reference in New Issue
Block a user