From 18d33e8280e5dc4c36be328b48b7d5e337804edb Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Fri, 23 Nov 2007 14:50:23 +0100 Subject: Spiral: haddock docs darcs-hash:20071123135023-32816-d2a97f42229174df9cb54d1ebfbede71e0bc0ff8.gz --- XMonad/Layout/Spiral.hs | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) (limited to 'XMonad/Layout/Spiral.hs') diff --git a/XMonad/Layout/Spiral.hs b/XMonad/Layout/Spiral.hs index b865f4d..6900af4 100644 --- a/XMonad/Layout/Spiral.hs +++ b/XMonad/Layout/Spiral.hs @@ -5,7 +5,7 @@ -- Module : XMonad.Layout.Spiral -- Copyright : (c) Joe Thornber -- License : BSD3-style (see LICENSE) --- +-- -- Maintainer : Joe Thornber -- Stability : stable -- Portability : portable @@ -30,14 +30,19 @@ import XMonad.Layouts import XMonad.StackSet ( integrate ) -- $usage --- You can use this module with the following in your Config.hs file: +-- You can use this module with the following in your @~\/.xmonad\/xmonad.hs@: -- --- > import XMonad.Layout.Spiral +-- > import XMonad.Layout.Spiral +-- > import Data.Ratio -- --- > layouts = [ ..., Layout $ spiral (1 % 1), ... ] - --- %import XMonad.Layout.Spiral --- %layout , Layout $ spiral (1 % 1) +-- Then edit your @layoutHook@ by adding the Spiral layout: +-- +-- > myLayouts = spiral (1 % 1) ||| etc.. +-- > main = xmonad dafaultConfig { layoutHook = myLayouts } +-- +-- For more detailed instructions on editing the layoutHook see: +-- +-- "XMonad.Doc.Extending#Editing_the_layout_hook" fibs :: [Integer] fibs = 1 : 1 : zipWith (+) fibs (tail fibs) @@ -71,7 +76,7 @@ instance LayoutClass SpiralWithDir a where ratios = blend scale . reverse . take (length ws - 1) . mkRatios $ tail fibs rects = divideRects (zip ratios dirs) sc dirs = dropWhile (/= dir) $ case rot of - CW -> cycle [East .. North] + CW -> cycle [East .. North] CCW -> cycle [North, West, South, East] handleMessage (SpiralWithDir dir rot scale) = return . fmap resize . fromMessage where resize Expand = spiralWithDir dir rot $ (21 % 20) * scale -- cgit v1.2.3