Merge pull request #156 from strokyl/add_modifySpacing_message_handling_to_smartpacing

Add ModifySpacing message handling to SmartPacing and SmartSpacingWit…
This commit is contained in:
Brent Yorgey
2017-04-19 12:25:38 -04:00
committed by GitHub
2 changed files with 10 additions and 0 deletions

View File

@@ -4,6 +4,8 @@
### Breaking Changes
* Adding handling of modifySpacing message in smartSpacing and smartSpacingWithEdge layout modifier
* `XMonad.Actions.GridSelect`
- Added field `gs_bordercolor` to `GSConfig` to specify border color.

View File

@@ -107,6 +107,10 @@ instance LayoutModifier SmartSpacing a where
pureModifier _ _ _ [x] = ([x], 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
-- | 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
| 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