diff options
| author | Josh Rahm <rahm@google.com> | 2022-11-21 12:05:03 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2022-11-21 12:05:03 -0700 |
| commit | ee9be16599f20aef6d1d3fd15666c00452f85aba (patch) | |
| tree | 1aed66c1de2ce201463e3becc2d452d4a8aa2992 /src/Rahm/Desktop/Layout/Rotate.hs | |
| parent | a1636c65e05d02f7d4fc408137e1d37b412ce890 (diff) | |
| download | rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.tar.gz rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.tar.bz2 rde-ee9be16599f20aef6d1d3fd15666c00452f85aba.zip | |
Format with ormolu.
Diffstat (limited to 'src/Rahm/Desktop/Layout/Rotate.hs')
| -rw-r--r-- | src/Rahm/Desktop/Layout/Rotate.hs | 32 |
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 |