diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-06-11 20:34:39 +0200 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-06-11 20:34:39 +0200 |
commit | aa7b17533695687a9c31070f5d9845c52493856e (patch) | |
tree | 2045589e106c7bba57778278ebce9e7d5e8c8d8c | |
parent | bb778e7d5c38e5d68d350e11c61f0055000724c6 (diff) | |
download | XMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.tar.gz XMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.tar.xz XMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.zip |
Updates to work with recent API changes
darcs-hash:20070611183439-a5988-c3d6cc194fa83f012ab49d6d79130ff459dcdfe1.gz
Diffstat (limited to '')
-rw-r--r-- | Circle.hs | 3 | ||||
-rw-r--r-- | GreedyView.hs | 2 | ||||
-rw-r--r-- | HintedTile.hs | 10 | ||||
-rw-r--r-- | Mosaic.hs | 3 | ||||
-rw-r--r-- | RotView.hs | 2 | ||||
-rw-r--r-- | Spiral.hs | 3 | ||||
-rw-r--r-- | Tabbed.hs | 11 | ||||
-rw-r--r-- | TwoPane.hs | 3 |
8 files changed, 22 insertions, 15 deletions
@@ -2,9 +2,10 @@ module XMonadContrib.Circle (circle) where -- actually it's an ellipse import Graphics.X11.Xlib import XMonad +import StackSet (integrate) circle :: Layout -circle = Layout { doLayout = circleLayout, +circle = Layout { doLayout = \r -> circleLayout r . integrate, modifyLayout = return . const Nothing } circleLayout :: Rectangle -> [Window] -> X [(Window, Rectangle)] diff --git a/GreedyView.hs b/GreedyView.hs index 3303799..d9f48c2 100644 --- a/GreedyView.hs +++ b/GreedyView.hs @@ -25,7 +25,7 @@ module XMonadContrib.GreedyView (greedyView) where -import StackSet as W +import StackSet as W hiding (filter) import XMonad import Operations import Data.List (find) diff --git a/HintedTile.hs b/HintedTile.hs index f3a811a..22ea946 100644 --- a/HintedTile.hs +++ b/HintedTile.hs @@ -2,6 +2,7 @@ module XMonadContrib.HintedTile (tall, wide) where import XMonad import Operations (Resize(..), IncMasterN(..), applySizeHints) +import qualified StackSet as W import {-# SOURCE #-} Config (borderWidth) import Graphics.X11.Xlib import Graphics.X11.Xlib.Extras @@ -18,10 +19,11 @@ wide = tile splitVertically divideHorizontally tall = tile splitHorizontally divideVertically tile split divide nmaster delta frac = - Layout { doLayout = \r w -> do { hints <- sequence (map getHints w) - ; return $ zip w (tiler frac r `uncurry` splitAt nmaster hints) } - , modifyLayout = \m -> fmap resize (fromMessage m) `mplus` - fmap incmastern (fromMessage m) } + Layout { doLayout = \r w' -> let w = W.integrate w' + in do { hints <- sequence (map getHints w) + ; return $ zip w (tiler frac r `uncurry` splitAt nmaster hints) } + , modifyLayout = \m -> return $ fmap resize (fromMessage m) `mplus` + fmap incmastern (fromMessage m) } where resize Shrink = tile split divide nmaster delta (frac-delta) resize Expand = tile split divide nmaster delta (frac+delta) @@ -31,6 +31,7 @@ import Data.Ratio import Graphics.X11.Xlib import XMonad hiding ( trace ) import Operations ( full, Resize(Shrink, Expand) ) +import qualified StackSet as W import qualified Data.Map as M import Data.List ( sort ) import Data.Typeable ( Typeable ) @@ -68,7 +69,7 @@ flexibility :: Double flexibility = 0.1 mosaic :: Double -> Double -> M.Map NamedWindow [WindowHint] -> Layout -mosaic delta tileFrac hints = full { doLayout = mosaicL tileFrac hints, modifyLayout = return . mlayout } +mosaic delta tileFrac hints = full { doLayout = \r -> mosaicL tileFrac hints r . W.integrate, modifyLayout = return . mlayout } where mlayout x = (m1 `fmap` fromMessage x) `mplus` (m2 `fmap` fromMessage x) m1 Shrink = mosaic delta (tileFrac/(1+delta)) hints m1 Expand = mosaic delta (tileFrac*(1+delta)) hints @@ -13,7 +13,7 @@ import Data.List ( sortBy ) import Data.Maybe ( listToMaybe ) import XMonad -import StackSet +import StackSet hiding (filter) import qualified Operations as O rotView :: Bool -> X () @@ -4,6 +4,7 @@ import Graphics.X11.Xlib import Operations import Data.Ratio import XMonad +import qualified StackSet as W -- -- Spiral layout @@ -32,7 +33,7 @@ blend scale ratios = zipWith (+) ratios scaleFactors scaleFactors = map (* step) . reverse . take len $ [0..] spiral :: Rational -> Layout -spiral scale = Layout { doLayout = fibLayout, +spiral scale = Layout { doLayout = \r -> fibLayout r . W.integrate, modifyLayout = \m -> return $ fmap resize $ fromMessage m } where fibLayout sc ws = return $ zip ws rects @@ -24,10 +24,11 @@ import XMonadContrib.NamedWindows tabbed :: Layout tabbed = Layout { doLayout = dolay, modifyLayout = const (return Nothing) } -dolay :: Rectangle -> [Window] -> X [(Window, Rectangle)] -dolay sc [w] = return [(w,sc)] -dolay sc@(Rectangle x y wid _) ws = - do let ts = gentabs x y wid (length ws) +dolay :: Rectangle -> W.Stack Window -> X [(Window, Rectangle)] +dolay sc (W.Node w [] []) = return [(w,sc)] +dolay sc@(Rectangle x y wid _) s@(W.Node w _ _) = + do let ws = W.integrate s + ts = gentabs x y wid (length ws) tws = zip ts ws maketab (t,w) = newDecoration w t 1 0x000000 0x777777 (drawtab t w) (focus w) drawtab r@(Rectangle _ _ wt ht) w d w' gc = @@ -48,7 +49,7 @@ dolay sc@(Rectangle x y wid _) ws = (fromIntegral (wt `div` 2) - fromIntegral (namew `div` 2)) (fromIntegral (ht `div` 2) + fromIntegral (nameh `div` 2)) name forM tws maketab - return [ (w,shrink sc) | w <- ws ] + return [ (w,shrink sc) ] shrink :: Rectangle -> Rectangle shrink (Rectangle x y w h) = Rectangle x (y+tabsize) w (h-tabsize) @@ -13,9 +13,10 @@ import qualified StackSet as W import Control.Monad.State (gets) twoPane :: Rational -> Rational -> Layout -twoPane delta split = Layout { doLayout = arrange, modifyLayout = message } +twoPane delta split = Layout { doLayout = \r -> arrange r . W.integrate, modifyLayout = message } where arrange rect ws@(w:x:_) = do + -- TODO this is buggy, it might peek another workspace (Just f) <- gets (W.peek . windowset) -- safe because of pattern match above let y = if f == w then x else f (left, right) = splitHorizontallyBy split rect |