diff options
author | Peter De Wachter <pdewacht@gmail.com> | 2007-06-21 21:12:07 +0200 |
---|---|---|
committer | Peter De Wachter <pdewacht@gmail.com> | 2007-06-21 21:12:07 +0200 |
commit | ca2517b0ea671fb5bb1068d560c40f665626b001 (patch) | |
tree | 77960dc698a507cd6582a270244ed9817f8bb6a7 | |
parent | e015cdafd06f7d9bfe7d10a8a1d50c641bff1165 (diff) | |
download | XMonadContrib-ca2517b0ea671fb5bb1068d560c40f665626b001.tar.gz XMonadContrib-ca2517b0ea671fb5bb1068d560c40f665626b001.tar.xz XMonadContrib-ca2517b0ea671fb5bb1068d560c40f665626b001.zip |
Circle: raise the focus window
darcs-hash:20070621191207-06a25-e3d7b4835126c33087d251052a6483e0d9cc5807.gz
-rw-r--r-- | Circle.hs | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -20,7 +20,7 @@ module XMonadContrib.Circle ( import Graphics.X11.Xlib import XMonad -import StackSet (integrate) +import StackSet (integrate, Stack(..)) -- $usage -- You can use this module with the following in your Config.hs file: @@ -28,7 +28,7 @@ import StackSet (integrate) -- > import XMonadContrib.Circle circle :: Layout a -circle = Layout { doLayout = \r -> return . circleLayout r . integrate, +circle = Layout { doLayout = \r s -> return . raise (length (up s)) . circleLayout r $ integrate s, modifyLayout = return . const Nothing } circleLayout :: Rectangle -> [a] -> [(a, Rectangle)] @@ -37,6 +37,9 @@ circleLayout r (w:ws) = master : rest where master = (w, center r) rest = zip ws $ map (satellite r) [0, pi * 2 / fromIntegral (length ws) ..] +raise :: Int -> [a] -> [a] +raise n xs = xs !! n : take n xs ++ drop (n + 1) xs + center :: Rectangle -> Rectangle center (Rectangle sx sy sw sh) = Rectangle x y w h where s = sqrt 2 :: Double |