From 7e67641858582a1408b1145b5f924e8c33e6629d Mon Sep 17 00:00:00 2001 From: Josh Rahm Date: Thu, 4 Nov 2021 13:25:11 -0600 Subject: Clean up LayoutDraw.hs --- src/Internal/Layout.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'src/Internal/Layout.hs') 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 -- cgit