aboutsummaryrefslogtreecommitdiff
path: root/src/Internal/Layout.hs
diff options
context:
space:
mode:
authorJosh Rahm <rahm@google.com>2021-11-04 13:25:11 -0600
committerJosh Rahm <rahm@google.com>2021-11-04 13:25:11 -0600
commit9b110e385c262f70d49bd5d21913864ed0e6847c (patch)
tree5cc7e35028489ca40a8fe36a3e020e7c48629e20 /src/Internal/Layout.hs
parent79df73d81c4b7b6b0676360b34f668fb9502f0d4 (diff)
downloadrde-9b110e385c262f70d49bd5d21913864ed0e6847c.tar.gz
rde-9b110e385c262f70d49bd5d21913864ed0e6847c.tar.bz2
rde-9b110e385c262f70d49bd5d21913864ed0e6847c.zip
Clean up LayoutDraw.hs
Diffstat (limited to 'src/Internal/Layout.hs')
-rw-r--r--src/Internal/Layout.hs11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/Internal/Layout.hs b/src/Internal/Layout.hs
index 06ac7d6..cb8c19b 100644
--- a/src/Internal/Layout.hs
+++ b/src/Internal/Layout.hs
@@ -97,14 +97,19 @@ data HFlipLayout = HFlipLayout deriving (Typeable)
data Zoomable a = Zoomable Bool Float Float -- True if zooming in on the focused window.
deriving (Show, Read)
-data ToggleZoom = ToggleZoom
+-- Toggles if the current window should be zoomed or not. Set the boolean
+-- to set the zoom.
+data ZoomModifier =
+ ToggleZoom |
+ Zoom |
+ Unzoom
deriving (Typeable)
instance Message FlipLayout where
instance Message HFlipLayout where
-instance Message ToggleZoom where
+instance Message ZoomModifier where
instance (Eq a) => LayoutModifier Flippable a where
pureModifier (Flippable flip) (Rectangle sx _ sw _) stack returned =
@@ -179,6 +184,8 @@ instance (Eq a) => LayoutModifier Zoomable a where
ExpandZoom -> 1) * 0.02
handleZoom ToggleZoom = Zoomable (not showing) sw sh
+ handleZoom Zoom = Zoomable True sw sh
+ handleZoom Unzoom = Zoomable False sw sh
guard f | f > 1 = 1
| f < 0 = 0