diff options
author | Anders Engstrom <ankaan@gmail.com> | 2009-10-29 11:56:33 +0100 |
---|---|---|
committer | Anders Engstrom <ankaan@gmail.com> | 2009-10-29 11:56:33 +0100 |
commit | b80a3a755be29dfe1add6949f36a3211c246c439 (patch) | |
tree | 0903bd5661bbfd1187eb3b9e3f0c7b7875621fe1 /XMonad | |
parent | 490218a8dce6ae0fc4022fc33ba6a72b87b25205 (diff) | |
download | XMonadContrib-b80a3a755be29dfe1add6949f36a3211c246c439.tar.gz XMonadContrib-b80a3a755be29dfe1add6949f36a3211c246c439.tar.xz XMonadContrib-b80a3a755be29dfe1add6949f36a3211c246c439.zip |
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
Diffstat (limited to 'XMonad')
-rw-r--r-- | XMonad/Layout/MultiColumns.hs | 9 |
1 files changed, 6 insertions, 3 deletions
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 |