From e0ca57557bd1d83f968d402c44e6ae556ea2ac86 Mon Sep 17 00:00:00 2001 From: portnov84 Date: Sat, 21 Feb 2009 14:23:00 +0000 Subject: [PATCH] OneBig_resize.dpatch Add Shrink/Expand messages handling for OneBig layout. --- XMonad/Layout/OneBig.hs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/XMonad/Layout/OneBig.hs b/XMonad/Layout/OneBig.hs index 2b800887..365dfb41 100644 --- a/XMonad/Layout/OneBig.hs +++ b/XMonad/Layout/OneBig.hs @@ -43,6 +43,14 @@ data OneBig a = OneBig Float Float deriving (Read,Show) instance LayoutClass OneBig a where pureLayout = oneBigLayout + pureMessage = oneBigMessage + +-- | Processes Shrink/Expand messages +oneBigMessage :: OneBig a -> SomeMessage -> Maybe (OneBig a) +oneBigMessage (OneBig cx cy) m = fmap resize (fromMessage m) + where resize Shrink = OneBig (cx-delta) (cy-delta) + resize Expand = OneBig (cx+delta) (cy+delta) + delta = 3/100 -- | Main layout function oneBigLayout :: OneBig a -> Rectangle -> W.Stack a -> [(a, Rectangle)]