aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Layout/Layout.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-04-12 00:38:26 -0600
committerJosh Rahm <joshuarahm@gmail.com>2022-10-09 12:19:46 -0600
commitbc1f9daeac09beb20a2c587d259048aea3b03176 (patch)
tree3e7bda9a3859ed7abb1d36109fbeb59088150a4a /src/Rahm/Desktop/Layout/Layout.hs
parent9d4e7ae016180769eb050f4c2729475236f4ad34 (diff)
downloadrde-bc1f9daeac09beb20a2c587d259048aea3b03176.tar.gz
rde-bc1f9daeac09beb20a2c587d259048aea3b03176.tar.bz2
rde-bc1f9daeac09beb20a2c587d259048aea3b03176.zip
Break Rotate into it's own file.
Diffstat (limited to 'src/Rahm/Desktop/Layout/Layout.hs')
-rw-r--r--src/Rahm/Desktop/Layout/Layout.hs43
1 files changed, 3 insertions, 40 deletions
diff --git a/src/Rahm/Desktop/Layout/Layout.hs b/src/Rahm/Desktop/Layout/Layout.hs
index a871aa6..88143cd 100644
--- a/src/Rahm/Desktop/Layout/Layout.hs
+++ b/src/Rahm/Desktop/Layout/Layout.hs
@@ -29,10 +29,13 @@ import Rahm.Desktop.Windows
import Rahm.Desktop.Layout.ReinterpretMessage
import Rahm.Desktop.Layout.Pop
import Rahm.Desktop.Layout.Flip
+import Rahm.Desktop.Layout.Rotate
import qualified Data.Map as M
import qualified XMonad.StackSet as W
+mods = reinterpretResize . poppable . flippable . rotateable
+
myLayout =
fullscreenFull $
avoidStruts $
@@ -88,12 +91,6 @@ reinterpretIncMaster ::
l a -> ModifiedLayout (ReinterpretMessage "IncMasterToResizeMaster") l a
reinterpretIncMaster = ModifiedLayout ReinterpretMessage
-mods =
- reinterpretResize .
- poppable .
- flippable .
- ModifiedLayout (Rotateable False)
-
data ModifyDescription m l a = ModifyDescription m (l a)
deriving (Show, Read)
@@ -138,37 +135,3 @@ instance DescriptionModifier TallDescriptionModifier Tall where
instance DescriptionModifier ThreeColDescMod ThreeCol where
newDescription _ (ThreeCol mast _ _) _ = "ThreeCol(" ++ show mast ++ ")"
newDescription _ (ThreeColMid mast _ _) _ = "ThreeColMid(" ++ show mast ++ ")"
-
-newtype Rotateable a = Rotateable Bool -- True if rotated
- deriving (Show, Read)
-
-data DoRotate = DoRotate deriving (Typeable)
-
-instance Message DoRotate where
-
-instance (Eq a) => LayoutModifier Rotateable a where
- pureModifier (Rotateable rotate) (Rectangle x' y' sw sh) _ returned =
- if rotate
- then (map (second (unzero . scaleRect . mirrorRect . zero)) returned, Nothing)
- else (returned, Nothing)
- where
- zero (Rectangle x y w h) = Rectangle (x - x') (y - y') w h
- unzero (Rectangle x y w h) = Rectangle (x + x') (y + y') w h
-
- scaleRect (Rectangle x y w h) =
- Rectangle (x * fi sw `div` fi sh)
- (y * fi sh `div` fi sw)
- (w * sw `div` sh)
- (h * sh `div` sw)
-
- fi = fromIntegral
-
-
- pureMess (Rotateable rot) mess =
- fmap (\DoRotate -> Rotateable (not rot)) (fromMessage mess)
-
- modifyDescription (Rotateable rot) underlying =
- let descr = description underlying in
- if rot
- then descr ++ " Rotated"
- else descr