mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 20:51:52 -07:00
OneBig_resize.dpatch
Add Shrink/Expand messages handling for OneBig layout.
This commit is contained in:
@@ -43,6 +43,14 @@ data OneBig a = OneBig Float Float deriving (Read,Show)
|
|||||||
|
|
||||||
instance LayoutClass OneBig a where
|
instance LayoutClass OneBig a where
|
||||||
pureLayout = oneBigLayout
|
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
|
-- | Main layout function
|
||||||
oneBigLayout :: OneBig a -> Rectangle -> W.Stack a -> [(a, Rectangle)]
|
oneBigLayout :: OneBig a -> Rectangle -> W.Stack a -> [(a, Rectangle)]
|
||||||
|
Reference in New Issue
Block a user