mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 03:20:21 -07:00
Add ModifySpacing message handling to SmartPacing and SmartSpacingWithEdge
This commit is contained in:
parent
8984ce64bb
commit
b4e7ab3d37
@ -4,6 +4,8 @@
|
|||||||
|
|
||||||
### Breaking Changes
|
### Breaking Changes
|
||||||
|
|
||||||
|
* Adding handling of modifySpacing message in smartSpacing and smartSpacingWithEdge layout modifier
|
||||||
|
|
||||||
* `XMonad.Actions.GridSelect`
|
* `XMonad.Actions.GridSelect`
|
||||||
|
|
||||||
- Added field `gs_bordercolor` to `GSConfig` to specify border color.
|
- Added field `gs_bordercolor` to `GSConfig` to specify border color.
|
||||||
|
@ -107,6 +107,10 @@ instance LayoutModifier SmartSpacing a where
|
|||||||
pureModifier _ _ _ [x] = ([x], Nothing)
|
pureModifier _ _ _ [x] = ([x], Nothing)
|
||||||
pureModifier (SmartSpacing p) _ _ wrs = (map (second $ shrinkRect p) wrs, Nothing)
|
pureModifier (SmartSpacing p) _ _ wrs = (map (second $ shrinkRect p) wrs, Nothing)
|
||||||
|
|
||||||
|
pureMess (SmartSpacing px) m
|
||||||
|
| Just (ModifySpacing f) <- fromMessage m = Just $ SmartSpacing $ max 0 $ f px
|
||||||
|
| otherwise = Nothing
|
||||||
|
|
||||||
modifierDescription (SmartSpacing p) = "SmartSpacing " ++ show p
|
modifierDescription (SmartSpacing p) = "SmartSpacing " ++ show p
|
||||||
|
|
||||||
-- | Surrounds all windows with blank space, and adds the same amount of spacing
|
-- | Surrounds all windows with blank space, and adds the same amount of spacing
|
||||||
@ -126,4 +130,8 @@ instance LayoutModifier SmartSpacingWithEdge a where
|
|||||||
| maybe False (\s -> null (up s) && null (down s)) (stack w) = runLayout w r
|
| maybe False (\s -> null (up s) && null (down s)) (stack w) = runLayout w r
|
||||||
| otherwise = runLayout w (shrinkRect p r)
|
| otherwise = runLayout w (shrinkRect p r)
|
||||||
|
|
||||||
|
pureMess (SmartSpacingWithEdge px) m
|
||||||
|
| Just (ModifySpacing f) <- fromMessage m = Just $ SmartSpacingWithEdge $ max 0 $ f px
|
||||||
|
| otherwise = Nothing
|
||||||
|
|
||||||
modifierDescription (SmartSpacingWithEdge p) = "SmartSpacingWithEdge " ++ show p
|
modifierDescription (SmartSpacingWithEdge p) = "SmartSpacingWithEdge " ++ show p
|
||||||
|
Loading…
x
Reference in New Issue
Block a user