diff options
author | Adam Vogt <vogt.adam@gmail.com> | 2009-05-02 01:31:36 +0200 |
---|---|---|
committer | Adam Vogt <vogt.adam@gmail.com> | 2009-05-02 01:31:36 +0200 |
commit | 8700b67ae680c67c60bbdc1b3213903e9b6628de (patch) | |
tree | 80eb2ac0720657f79747f0cb3a486f255e3eb7b2 /XMonad/Layout | |
parent | a7d582ee7e214d548a1459301eb7ee51804522dd (diff) | |
download | XMonadContrib-8700b67ae680c67c60bbdc1b3213903e9b6628de.tar.gz XMonadContrib-8700b67ae680c67c60bbdc1b3213903e9b6628de.tar.xz XMonadContrib-8700b67ae680c67c60bbdc1b3213903e9b6628de.zip |
Add changeMaster function to L.Mosaic
Ignore-this: eca2a48fb987bb871ad93e6c6bf1a186
darcs-hash:20090501233136-1499c-1a6628819fee9936cabf22b13770bb43d258e115.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r-- | XMonad/Layout/Mosaic.hs | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/XMonad/Layout/Mosaic.hs b/XMonad/Layout/Mosaic.hs index aec2339..ef72c50 100644 --- a/XMonad/Layout/Mosaic.hs +++ b/XMonad/Layout/Mosaic.hs @@ -23,6 +23,7 @@ module XMonad.Layout.Mosaic ( ,steeper ,growMaster ,shrinkMaster + ,changeMaster ) where @@ -134,12 +135,15 @@ shallower [] = [] shallower xs = map (+(minimum xs*2)) xs growMaster :: [Rational] -> [Rational] -growMaster [] = [] -growMaster (x:xs) = 2*x:xs +growMaster = changeMaster 2 shrinkMaster :: [Rational] -> [Rational] -shrinkMaster [] = [] -shrinkMaster (x:xs) = x/2:xs +shrinkMaster = changeMaster 0.5 + +-- | Multiply the area of the current master by a specified ratio +changeMaster :: Rational -> [Rational] -> [Rational] +changeMaster _ [] = [] +changeMaster f (x:xs) = f*x:xs splits :: Int -> Rectangle -> [Rational] -> [[Rectangle]] splits num rect = splitsL rect . makeTree . normalize |