mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-11 10:12:15 -07:00
Updates for Layout API change
This commit is contained in:
@@ -5,7 +5,7 @@ import XMonad
|
|||||||
|
|
||||||
circle :: Layout
|
circle :: Layout
|
||||||
circle = Layout { doLayout = circleLayout,
|
circle = Layout { doLayout = circleLayout,
|
||||||
modifyLayout = const Nothing }
|
modifyLayout = return . const Nothing }
|
||||||
|
|
||||||
circleLayout :: Rectangle -> [Window] -> X [(Window, Rectangle)]
|
circleLayout :: Rectangle -> [Window] -> X [(Window, Rectangle)]
|
||||||
circleLayout _ [] = return []
|
circleLayout _ [] = return []
|
||||||
|
@@ -33,7 +33,7 @@ blend scale ratios = zipWith (+) ratios scaleFactors
|
|||||||
|
|
||||||
spiral :: Rational -> Layout
|
spiral :: Rational -> Layout
|
||||||
spiral scale = Layout { doLayout = fibLayout,
|
spiral scale = Layout { doLayout = fibLayout,
|
||||||
modifyLayout = \m -> fmap resize $ fromMessage m }
|
modifyLayout = \m -> return $ fmap resize $ fromMessage m }
|
||||||
where
|
where
|
||||||
fibLayout sc ws = return $ zip ws rects
|
fibLayout sc ws = return $ zip ws rects
|
||||||
where ratios = blend scale . reverse . take (length ws - 1) . mkRatios $ tail fibs
|
where ratios = blend scale . reverse . take (length ws - 1) . mkRatios $ tail fibs
|
||||||
|
@@ -24,7 +24,7 @@ twoPane delta split = Layout { doLayout = arrange, modifyLayout = message }
|
|||||||
-- there are one or zero windows
|
-- there are one or zero windows
|
||||||
arrange rect ws = return . map (\w -> (w, rect)) $ ws
|
arrange rect ws = return . map (\w -> (w, rect)) $ ws
|
||||||
|
|
||||||
message x = case fromMessage x of
|
message x = return $ case fromMessage x of
|
||||||
Just Shrink -> Just (twoPane delta (split - delta))
|
Just Shrink -> Just (twoPane delta (split - delta))
|
||||||
Just Expand -> Just (twoPane delta (split + delta))
|
Just Expand -> Just (twoPane delta (split + delta))
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
|
Reference in New Issue
Block a user