diff options
Diffstat (limited to 'src/Internal/Layout.hs')
| -rw-r--r-- | src/Internal/Layout.hs | 22 |
1 files changed, 17 insertions, 5 deletions
diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs index 562f947..6c78c70 100644 --- a/src/Internal/Layout.hs +++ b/src/Internal/Layout.hs @@ -25,7 +25,7 @@ import XMonad import XMonad.Core import XMonad.Layout.NoBorders (smartBorders, noBorders) -import Internal.LayoutZipper +import Internal.LayoutList import Internal.Windows import qualified Data.Map as M @@ -36,9 +36,9 @@ myLayout = avoidStruts $ spacingRaw True (Border 5 5 5 5) True (Border 5 5 5 5) True $ layoutZipper $ - mods (spiral (6/7)) |: + mods (reinterpretIncMaster $ spiral (6/7)) |: mods (modifyMosaic (MosaicAlt M.empty :: MosaicAlt Window)) |: - mods (Corner (3/4) (3/100)) |: + mods (reinterpretIncMaster $ Corner (3/4) (3/100)) |: mods (ModifyDescription TallDescriptionModifier (Tall 1 (3/100) (1/2))) |: mods (ModifyDescription ThreeColDescMod (ThreeCol 1 (3/100) (1/2))) |: mods Grid |: @@ -69,14 +69,14 @@ instance DoReinterpret "ForMosaic" where -- IncMaster message reinterpretMessage _ (fromMessage -> Just (IncMasterN n)) = do - (fmap $ SomeMessage . + fmap (SomeMessage . (if n > 0 then expandWindowAlt else shrinkWindowAlt)) <$> getFocusedWindow -- ResizeMaster message reinterpretMessage _ (fromMessage -> Just m) = do - (fmap $ SomeMessage . + fmap (SomeMessage . (case m of Expand -> expandWindowAlt Shrink -> shrinkWindowAlt)) <$> getFocusedWindow @@ -84,6 +84,14 @@ instance DoReinterpret "ForMosaic" where -- Messages that don't match the above, just leave it unmodified. reinterpretMessage _ m = return (Just m) +instance DoReinterpret "IncMasterToResizeMaster" where + reinterpretMessage _ (fromMessage -> Just (IncMasterN n)) = + return $ Just $ + if n > 0 + then SomeMessage Expand + else SomeMessage Shrink + reinterpretMessage _ m = return (Just m) + -- Data construct for association a DoReinterpret function with a concrete -- construct that can be used in the LayoutModifier instance. -- @@ -117,6 +125,10 @@ instance (DoReinterpret k) => modifyMosaic :: l a -> ModifiedLayout (ReinterpretMessage "ForMosaic") l a modifyMosaic = ModifiedLayout ReinterpretMessage +reinterpretIncMaster :: + l a -> ModifiedLayout (ReinterpretMessage "IncMasterToResizeMaster") l a +reinterpretIncMaster = ModifiedLayout ReinterpretMessage + mods = ModifiedLayout (Zoomable False 0.05 0.05) . ModifiedLayout (Flippable False) . |