From ea5a3128b08e889512b09ef735ddb573317b7ef3 Mon Sep 17 00:00:00 2001 From: Lukas Mai Date: Fri, 21 Mar 2008 23:13:15 +0100 Subject: XMonad.Layout.NoBorders: first attempt at documenting smartBorders darcs-hash:20080321221315-462cf-23d1355c7f0a57d49f9b12e27d87c4b3d9299b3c.gz --- XMonad/Layout/NoBorders.hs | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'XMonad/Layout') diff --git a/XMonad/Layout/NoBorders.hs b/XMonad/Layout/NoBorders.hs index 783d814..ec7de5c 100644 --- a/XMonad/Layout/NoBorders.hs +++ b/XMonad/Layout/NoBorders.hs @@ -58,9 +58,12 @@ instance LayoutModifier WithBorder Window where where ws = map fst wrs +-- | Removes all window borders from the specified layout. noBorders :: LayoutClass l Window => l Window -> ModifiedLayout WithBorder l Window -noBorders = ModifiedLayout $ WithBorder 0 [] +noBorders = withBorder 0 +-- | Forces a layout to use the specified border width. 'noBorders' is +-- equivalent to @'withBorder' 0@. withBorder :: LayoutClass l a => Dimension -> l a -> ModifiedLayout WithBorder l a withBorder b = ModifiedLayout $ WithBorder b [] @@ -94,11 +97,12 @@ instance LayoutModifier SmartBorder Window where nonzerorect (Rectangle _ _ 0 0) = False nonzerorect _ = True +-- | Removes the borders from a window under one of the following conditions: -- --- | You can cleverly set no borders on a range of layouts, using a --- layoutHook like so: +-- * There is only one screen and only one window. In this case it's obvious +-- that it has the focus, so no border is needed. -- --- > layoutHook = smartBorders $ tiled ||| Mirror tiled ||| ... +-- * A floating window covers the entire screen (e.g. mplayer). -- smartBorders :: LayoutClass l a => l a -> ModifiedLayout SmartBorder l a smartBorders = ModifiedLayout (SmartBorder []) -- cgit v1.2.3