diff options
| author | Josh Rahm <rahm@google.com> | 2021-11-08 09:43:39 -0700 |
|---|---|---|
| committer | Josh Rahm <rahm@google.com> | 2021-11-08 09:43:39 -0700 |
| commit | 909665a8e8938de4e6f62b2da3e32f6597b3a8a5 (patch) | |
| tree | fb697ba94b73283ce4dcc962e7ae87df02bf230b /src/Internal | |
| parent | 278cf20058ad788676a7abe82a65083f41f84e17 (diff) | |
| parent | efef2ad31b0a1ce7ebcc2a635114f5a1d3f82ec8 (diff) | |
| download | rde-909665a8e8938de4e6f62b2da3e32f6597b3a8a5.tar.gz rde-909665a8e8938de4e6f62b2da3e32f6597b3a8a5.tar.bz2 rde-909665a8e8938de4e6f62b2da3e32f6597b3a8a5.zip | |
Merge remote-tracking branch 'josher/master'master
Diffstat (limited to 'src/Internal')
| -rw-r--r-- | src/Internal/Layout.hs | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs index f28ae4d..8903fed 100644 --- a/src/Internal/Layout.hs +++ b/src/Internal/Layout.hs @@ -38,7 +38,7 @@ myLayout = Grid ||| Dishes 2 (1/6) ||| (MosaicAlt M.empty :: MosaicAlt Window) ||| - (D.Dwindle D.R D.CW 1.5 1.1) + D.Dwindle D.R D.CW 1.5 1.1 data ModifyDescription m l a = ModifyDescription m (l a) deriving (Show, Read) @@ -82,18 +82,19 @@ instance DescriptionModifier TallDescriptionModifier Tall where instance DescriptionModifier ThreeColDescMod ThreeCol where newDescription _ (ThreeCol mast _ _) _ = "ThreeCol(" ++ show mast ++ ")" + newDescription _ (ThreeColMid mast _ _) _ = "ThreeColMid(" ++ show mast ++ ")" data ResizeZoom = ShrinkZoom | ExpandZoom deriving (Typeable) instance Message ResizeZoom where -data Flippable a = Flippable Bool -- True if flipped +newtype Flippable a = Flippable Bool -- True if flipped deriving (Show, Read) -data HFlippable a = HFlippable Bool -- True if flipped +newtype HFlippable a = HFlippable Bool -- True if flipped deriving (Show, Read) -data Rotateable a = Rotateable Bool -- True if rotated +newtype Rotateable a = Rotateable Bool -- True if rotated deriving (Show, Read) data FlipLayout = FlipLayout deriving (Typeable) @@ -140,7 +141,7 @@ instance (Eq a) => LayoutModifier Rotateable a where pureMess (Rotateable rot) mess = - fmap (\(DoRotate) -> Rotateable (not rot)) (fromMessage mess) + fmap (\DoRotate -> Rotateable (not rot)) (fromMessage mess) modifyDescription (Rotateable rot) underlying = let descr = description underlying in @@ -197,17 +198,17 @@ instance (Eq a) => LayoutModifier Zoomable a where (zoomed, rest) = partition ((==focused) . Just . fst) returned in case zoomed of [] -> return (rest, Nothing) - ((fwin, _):_) -> return $ ((fwin, Rectangle (x + wp) (y + hp) (w - fromIntegral (wp * 2)) (h - fromIntegral (hp * 2))) : rest, Nothing) + ((fwin, _):_) -> return ((fwin, Rectangle (x + wp) (y + hp) (w - fromIntegral (wp * 2)) (h - fromIntegral (hp * 2))) : rest, Nothing) else return (returned, Nothing) where - wp = floor $ (fromIntegral w) * ws - hp = floor $ (fromIntegral h) * hs + wp = floor $ fromIntegral w * ws + hp = floor $ fromIntegral h * hs handleMessOrMaybeModifyIt self@(Zoomable showing sw sh) mess = return $ (handleResize <$> fromMessage mess) - <|> ((Left . handleZoom) <$> fromMessage mess) + <|> (Left . handleZoom <$> fromMessage mess) where handleResize r = if showing |