diff options
| author | Josh Rahm <rahm@google.com> | 2021-11-04 13:25:11 -0600 |
|---|---|---|
| committer | Josh Rahm <joshuarahm@gmail.com> | 2022-10-09 12:19:45 -0600 |
| commit | 7e67641858582a1408b1145b5f924e8c33e6629d (patch) | |
| tree | 5cc7e35028489ca40a8fe36a3e020e7c48629e20 /src/Internal/Layout.hs | |
| parent | abf2d43e9d625e0587e78e69e4d17a3ba480c9bc (diff) | |
| download | rde-7e67641858582a1408b1145b5f924e8c33e6629d.tar.gz rde-7e67641858582a1408b1145b5f924e8c33e6629d.tar.bz2 rde-7e67641858582a1408b1145b5f924e8c33e6629d.zip | |
Clean up LayoutDraw.hs
Diffstat (limited to 'src/Internal/Layout.hs')
| -rw-r--r-- | src/Internal/Layout.hs | 11 |
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 |