From b80a3a755be29dfe1add6949f36a3211c246c439 Mon Sep 17 00:00:00 2001 From: Anders Engstrom Date: Thu, 29 Oct 2009 11:56:33 +0100 Subject: X.L.MultiCol constructor 0 NWin bugfig Ignore-this: e6a24f581593424461a8675984d14d25 Fix bug where the constructor did not accept catch-all columns. Also some minor cleaning. darcs-hash:20091029105633-8978f-5ba50b10b2337eebb3f77f0e4bb3d3ff10faeb42.gz --- XMonad/Layout/MultiColumns.hs | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout') diff --git a/XMonad/Layout/MultiColumns.hs b/XMonad/Layout/MultiColumns.hs index 5f7d2c1..201ba7e 100644 --- a/XMonad/Layout/MultiColumns.hs +++ b/XMonad/Layout/MultiColumns.hs @@ -58,14 +58,14 @@ import Control.Monad -- -- "XMonad.Doc.Extending#Editing_the_layout_hook" --- | Layout creator. +-- | Layout constructor. multiCol :: [Int] -- ^ Windows in each column, starting with master. Set to 0 to catch the rest. -> Int -- ^ Default value for all following columns. -> Rational -- ^ How much to change size each time. -> Rational -- ^ Initial size of master area, or column area if the size is negative. -> MultiCol a -multiCol n defn ds s = MultiCol (map (max 1) n) (max 1 defn) ds s 0 +multiCol n defn ds s = MultiCol (map (max 0) n) (max 0 defn) ds s 0 data MultiCol a = MultiCol { multiColNWin :: ![Int] @@ -115,8 +115,9 @@ getCol _ _ = -1 doL :: [Int] -> Rational -> Rectangle -> Int -> [Rectangle] doL nwin s r n = rlist where -- Number of columns to tile - size = floor $ abs s * fromIntegral (rect_width r) ncol = getCol (n-1) nwin + 1 + -- Compute the actual size + size = floor $ abs s * fromIntegral (rect_width r) -- Extract all but last column to tile c = take (ncol-1) nwin -- Compute number of windows in last column and add it to the others @@ -124,7 +125,9 @@ doL nwin s r n = rlist -- Compute width of columns width = if s>0 then if ncol==1 + -- Only one window then [fromIntegral $ rect_width r] + -- Give the master it's space and split the rest equally for the other columns else size:replicate (ncol-1) ((fromIntegral (rect_width r) - size) `div` (ncol-1)) else if fromIntegral ncol * abs s >= 1 -- Split equally -- cgit v1.2.3