mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 20:51:52 -07:00
Add changeMaster function to L.Mosaic
This commit is contained in:
@@ -23,6 +23,7 @@ module XMonad.Layout.Mosaic (
|
|||||||
,steeper
|
,steeper
|
||||||
,growMaster
|
,growMaster
|
||||||
,shrinkMaster
|
,shrinkMaster
|
||||||
|
,changeMaster
|
||||||
)
|
)
|
||||||
where
|
where
|
||||||
|
|
||||||
@@ -134,12 +135,15 @@ shallower [] = []
|
|||||||
shallower xs = map (+(minimum xs*2)) xs
|
shallower xs = map (+(minimum xs*2)) xs
|
||||||
|
|
||||||
growMaster :: [Rational] -> [Rational]
|
growMaster :: [Rational] -> [Rational]
|
||||||
growMaster [] = []
|
growMaster = changeMaster 2
|
||||||
growMaster (x:xs) = 2*x:xs
|
|
||||||
|
|
||||||
shrinkMaster :: [Rational] -> [Rational]
|
shrinkMaster :: [Rational] -> [Rational]
|
||||||
shrinkMaster [] = []
|
shrinkMaster = changeMaster 0.5
|
||||||
shrinkMaster (x:xs) = x/2:xs
|
|
||||||
|
-- | 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 :: Int -> Rectangle -> [Rational] -> [[Rectangle]]
|
||||||
splits num rect = splitsL rect . makeTree . normalize
|
splits num rect = splitsL rect . makeTree . normalize
|
||||||
|
Reference in New Issue
Block a user