diff options
Diffstat (limited to 'src/Rahm/Desktop/Layout/Layout.hs')
| -rw-r--r-- | src/Rahm/Desktop/Layout/Layout.hs | 58 |
1 files changed, 2 insertions, 56 deletions
diff --git a/src/Rahm/Desktop/Layout/Layout.hs b/src/Rahm/Desktop/Layout/Layout.hs index 135b9a0..a871aa6 100644 --- a/src/Rahm/Desktop/Layout/Layout.hs +++ b/src/Rahm/Desktop/Layout/Layout.hs @@ -28,6 +28,7 @@ import Rahm.Desktop.Layout.LayoutList import Rahm.Desktop.Windows import Rahm.Desktop.Layout.ReinterpretMessage import Rahm.Desktop.Layout.Pop +import Rahm.Desktop.Layout.Flip import qualified Data.Map as M import qualified XMonad.StackSet as W @@ -90,8 +91,7 @@ reinterpretIncMaster = ModifiedLayout ReinterpretMessage mods = reinterpretResize . poppable . - ModifiedLayout (Flippable False) . - ModifiedLayout (HFlippable False) . + flippable . ModifiedLayout (Rotateable False) @@ -139,25 +139,11 @@ instance DescriptionModifier ThreeColDescMod ThreeCol where newDescription _ (ThreeCol mast _ _) _ = "ThreeCol(" ++ show mast ++ ")" newDescription _ (ThreeColMid mast _ _) _ = "ThreeColMid(" ++ show mast ++ ")" -newtype Flippable a = Flippable Bool -- True if flipped - deriving (Show, Read) - -newtype HFlippable a = HFlippable Bool -- True if flipped - deriving (Show, Read) - newtype Rotateable a = Rotateable Bool -- True if rotated deriving (Show, Read) -data FlipLayout = FlipLayout deriving (Typeable) - -data HFlipLayout = HFlipLayout deriving (Typeable) - data DoRotate = DoRotate deriving (Typeable) -instance Message FlipLayout where - -instance Message HFlipLayout where - instance Message DoRotate where instance (Eq a) => LayoutModifier Rotateable a where @@ -186,43 +172,3 @@ instance (Eq a) => LayoutModifier Rotateable a where if rot then descr ++ " Rotated" else descr - -instance (Eq a) => LayoutModifier Flippable a where - pureModifier (Flippable flip) (Rectangle sx _ sw _) stack returned = - if flip - then (map (second doFlip) returned, Nothing) - else (returned, Nothing) - where - doFlip (Rectangle x y w h) = - Rectangle ((sx + fromIntegral sw) - x - fromIntegral w + sx) y w h - - pureMess (Flippable flip) message = - case fromMessage message of - Just FlipLayout -> Just (Flippable (not flip)) - Nothing -> Nothing - - modifyDescription (Flippable flipped) underlying = - let descr = description underlying in - if flipped - then descr ++ " Flipped" - else descr - -instance (Eq a) => LayoutModifier HFlippable a where - pureModifier (HFlippable flip) (Rectangle _ sy _ sh) stack returned = - if flip - then (map (second doFlip) returned, Nothing) - else (returned, Nothing) - where - doFlip (Rectangle x y w h) = - Rectangle x ((sy + fromIntegral sh) - y - fromIntegral h + sy) w h - - pureMess (HFlippable flip) message = - case fromMessage message of - Just HFlipLayout -> Just (HFlippable (not flip)) - Nothing -> Nothing - - modifyDescription (HFlippable flipped) underlying = - let descr = description underlying in - if flipped - then descr ++ " HFlipped" - else descr |