aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjoe.thornber <joe.thornber@gmail.com>2007-05-24 10:48:05 +0200
committerjoe.thornber <joe.thornber@gmail.com>2007-05-24 10:48:05 +0200
commit613fd14c30fd9980a727a1d1df3cb0d664a3d03c (patch)
tree845eb590096eb9c4f86b79eb9edc189cde54c7fa
parentc05068423f1d5106f2963328cf9f96eafe8d0945 (diff)
downloadXMonadContrib-613fd14c30fd9980a727a1d1df3cb0d664a3d03c.tar.gz
XMonadContrib-613fd14c30fd9980a727a1d1df3cb0d664a3d03c.tar.xz
XMonadContrib-613fd14c30fd9980a727a1d1df3cb0d664a3d03c.zip
[Spiral] remove old spiral code
darcs-hash:20070524084805-db939-212a8a4279ffb1eb58b90c34ec631fe7aaeb4898.gz
-rw-r--r--Spiral.hs23
1 files changed, 6 insertions, 17 deletions
diff --git a/Spiral.hs b/Spiral.hs
index a2dd794..f4a0452 100644
--- a/Spiral.hs
+++ b/Spiral.hs
@@ -1,4 +1,4 @@
-module XMonadContrib.Spiral (spiral, fibSpiral) where
+module XMonadContrib.Spiral (spiral) where
import Graphics.X11.Xlib
import Operations
@@ -13,19 +13,8 @@ import XMonad
-- defaultLayouts = [ full,
-- tall defaultWindowsInMaster defaultDelta (1%2),
-- wide defaultWindowsInMaster defaultDelta (1%2),
--- spiral (1000 % 1618) ]
+-- spiral (1 % 1) ]
--
-spiral :: Rational -> Layout
-spiral rat = Layout { doLayout = \sc ws -> return $ zip ws (divideRects (repeat rat) (length ws) East $ sc),
- modifyLayout = \m -> fmap resize (fromMessage m)}
-
- where resize Expand = let newRat = ((numerator rat + 10) % (denominator rat))
- normRat = if numerator newRat > denominator newRat then rat else newRat in
- spiral normRat
- resize Shrink = let newRat = ((numerator rat - 10) % (denominator rat))
- normRat = if numerator newRat < 0 then rat else newRat in
- spiral normRat
-
fibs :: [Integer]
fibs = 1 : 1 : (zipWith (+) fibs (tail fibs))
@@ -35,14 +24,14 @@ fibRatios = ratios fibs
ratios (x:y:rs) = (x % y) : ratios (y:rs)
ratios _ = []
-fibSpiral :: Rational -> Layout
-fibSpiral scale = Layout { doLayout = fibLayout,
+spiral :: Rational -> Layout
+spiral scale = Layout { doLayout = fibLayout,
modifyLayout = \m -> fmap resize (fromMessage m) }
where
fibLayout sc ws = return $ zip ws (divideRects (map (* scale) . reverse . take len $ fibRatios) len East sc)
where len = length ws
- resize Expand = fibSpiral $ (11 % 10) * scale
- resize Shrink = fibSpiral $ (10 % 11) * scale
+ resize Expand = spiral $ (11 % 10) * scale
+ resize Shrink = spiral $ (10 % 11) * scale
data Direction = East | South | West | North