From 0ad5b3a5be07a6dcae53367c401080a379e5c3b1 Mon Sep 17 00:00:00 2001 From: Kai Grossjohann Date: Sat, 21 Jul 2007 17:08:25 +0200 Subject: fix 3col layout for nmaster + 1 windows Do like two column layout if there are nmaster+1 windows (putting 1 window in the right column). darcs-hash:20070721150825-07ca0-93b9747e62c1707a2dfac33bc0a5af966c6ae534.gz --- ThreeColumns.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ThreeColumns.hs b/ThreeColumns.hs index 6d74cb9..c8edc5f 100644 --- a/ThreeColumns.hs +++ b/ThreeColumns.hs @@ -20,7 +20,7 @@ module XMonadContrib.ThreeColumns ( import XMonad import qualified StackSet as W -import Operations ( Resize(..), IncMasterN(..), splitVertically, tall ) +import Operations ( Resize(..), IncMasterN(..), splitVertically, tall, splitHorizontallyBy ) import Data.Ratio @@ -52,10 +52,12 @@ threeCol nmaster delta frac = -- | tile3. Compute window positions using 3 panes tile3 :: Rational -> Rectangle -> Int -> Int -> [Rectangle] -tile3 f r nmaster n = if n <= nmaster || nmaster == 0 - then splitVertically n r - else splitVertically nmaster r1 ++ splitVertically nmid r2 ++ splitVertically nright r3 +tile3 f r nmaster n + | n <= nmaster || nmaster == 0 = splitVertically n r + | n <= nmaster+1 = splitVertically nmaster s1 ++ splitVertically (n-nmaster) s2 + | otherwise = splitVertically nmaster r1 ++ splitVertically nmid r2 ++ splitVertically nright r3 where (r1, r2, r3) = split3HorizontallyBy f r + (s1, s2) = splitHorizontallyBy f r nslave = (n - nmaster) nmid = floor (nslave % 2) nright = (n - nmaster - nmid) -- cgit v1.2.3