aboutsummaryrefslogtreecommitdiff
path: root/src/Rahm/Desktop/Layout/Rotate.hs
diff options
context:
space:
mode:
authorJosh Rahm <joshuarahm@gmail.com>2022-11-21 20:57:42 -0700
committerJosh Rahm <joshuarahm@gmail.com>2022-11-21 20:57:42 -0700
commit8888a83ef06d16d4bdd3c06bef721fff43f04175 (patch)
treef94c6175c935a05846b6322d29625e354ff2cd17 /src/Rahm/Desktop/Layout/Rotate.hs
parente76a1c089951a72055bc8fc35808ccfa8988ddec (diff)
parent7d6e83479719e04b77a8230a7ecf03e971cd5fc6 (diff)
downloadrde-8888a83ef06d16d4bdd3c06bef721fff43f04175.tar.gz
rde-8888a83ef06d16d4bdd3c06bef721fff43f04175.tar.bz2
rde-8888a83ef06d16d4bdd3c06bef721fff43f04175.zip
Merge branch 'v017' of josher.dev:rde into v017
Diffstat (limited to 'src/Rahm/Desktop/Layout/Rotate.hs')
-rw-r--r--src/Rahm/Desktop/Layout/Rotate.hs32
1 files changed, 17 insertions, 15 deletions
diff --git a/src/Rahm/Desktop/Layout/Rotate.hs b/src/Rahm/Desktop/Layout/Rotate.hs
index 8a8583a..e6f9a64 100644
--- a/src/Rahm/Desktop/Layout/Rotate.hs
+++ b/src/Rahm/Desktop/Layout/Rotate.hs
@@ -3,15 +3,17 @@
-- Layout modifier which optionally rotates the underlying layout. This actually
-- uses the mirrorRect, so it's not strictly rotating, but when combined with
-- flipping it works.
-module Rahm.Desktop.Layout.Rotate (
- rotateable,
- rotateLayout,
- Rotate) where
+module Rahm.Desktop.Layout.Rotate
+ ( rotateable,
+ rotateLayout,
+ Rotate,
+ )
+where
+import Control.Arrow (second)
+import Data.Default (Default (..))
import XMonad
import XMonad.Layout.LayoutModifier
-import Data.Default (Default(..))
-import Control.Arrow (second)
-- Just a wrapper over a Bool.
newtype Rotate a = Rotate Bool
@@ -44,19 +46,19 @@ instance (Eq a) => LayoutModifier Rotate a where
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)
+ Rectangle
+ (x * fi sw `div` fi sh)
+ (y * fi sh `div` fi sw)
+ (w * sw `div` sh)
+ (h * sh `div` sw)
fi = fromIntegral
-
pureMess r (fromMessage -> Just (RotateMessage f)) = Just (f r)
pureMess _ _ = Nothing
modifyDescription (Rotate rot) underlying =
- let descr = description underlying in
- if rot
- then descr ++ " Rotated"
- else descr
+ let descr = description underlying
+ in if rot
+ then descr ++ " Rotated"
+ else descr