[xmonad] darcs patch: Added smart spacing to the spacing module

Brent Yorgey byorgey at seas.upenn.edu
Mon Sep 24 19:56:27 CEST 2012


Thanks, pushed!

-Brent

On Sat, Sep 22, 2012 at 08:53:04PM -0700, daedalusinfinity at gmail.com wrote:
> 1 patch for repository http://code.haskell.org/XMonadContrib:
> 
> Sat Sep 22 20:45:27 PDT 2012  daedalusinfinity at gmail.com
>   * Added smart spacing to the spacing module
>   Added smart spacing to the spacing module, which adds spacing to all windows,
>   except to windows on singleton workspaces.
> 

> 
> [Added smart spacing to the spacing module
> daedalusinfinity at gmail.com**20120923034527
>  Ignore-this: 9104bc8feb832f63f2f18998c0f7ba92
>  Added smart spacing to the spacing module, which adds spacing to all windows,
>  except to windows on singleton workspaces.
> ] {
> hunk ./XMonad/Layout/Spacing.hs 21
>                                 -- $usage
>  
>                                 spacing, Spacing,
> +                               smartSpacing, SmartSpacing,
>  
>                               ) where
>  
> hunk ./XMonad/Layout/Spacing.hs 56
>  
>  shrinkRect :: Int -> Rectangle -> Rectangle
>  shrinkRect p (Rectangle x y w h) = Rectangle (x+fi p) (y+fi p) (w-2*fi p) (h-2*fi p)
> +
> +-- | Surrounds all windows with blank space, except when the window is the only
> +-- visible window on the current workspace.
> +smartSpacing :: Int -> l a -> ModifiedLayout SmartSpacing l a
> +smartSpacing p = ModifiedLayout (SmartSpacing p)
> +
> +data SmartSpacing a = SmartSpacing Int deriving (Show, Read)
> +
> +instance LayoutModifier SmartSpacing a where
> +
> +    pureModifier _ _ _ [x] = ([x], Nothing)
> +    pureModifier (SmartSpacing p) _ _ wrs = (map (second $ shrinkRect p) wrs, Nothing)
> +
> +    modifierDescription (SmartSpacing p) = "SmartSpacing " ++ show p
> }
> 


> _______________________________________________
> xmonad mailing list
> xmonad at haskell.org
> http://www.haskell.org/mailman/listinfo/xmonad




More information about the xmonad mailing list