From b60cef63b0a1706cb556b554a194c7679aff5e4b Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 22 Nov 2007 05:27:20 +0100 Subject: HintedTile: orientation bug fix, remove wide and tall in favor of the Tall and Wide constructors. darcs-hash:20071122042720-a5988-fb7db804a00e8f2c4a8c845236d454aa1c76476b.gz --- XMonad/Layout/HintedTile.hs | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'XMonad') diff --git a/XMonad/Layout/HintedTile.hs b/XMonad/Layout/HintedTile.hs index dd5808a..0f9d766 100644 --- a/XMonad/Layout/HintedTile.hs +++ b/XMonad/Layout/HintedTile.hs @@ -18,7 +18,7 @@ module XMonad.Layout.HintedTile ( -- * Usage -- $usage - tall, wide ) where + HintedTile(..), Orientation(..)) where import XMonad import XMonad.Layouts ( Resize(..), IncMasterN(..) ) @@ -35,25 +35,21 @@ import Control.Monad.Reader -- -- Then edit your @layoutHook@ by adding the HintedTile layout: -- --- > myLayouts = tall 1 0.1 0.5 ||| Full ||| etc.. +-- > myLayouts = HintedTile 1 0.1 0.5 Tall ||| Full ||| etc.. -- > main = xmonad dafaultConfig { layoutHook = myLayouts } -- -- For more detailed instructions on editing the layoutHook see: -- -- "XMonad.Doc.Extending#Editing_the_layout_hook" -data HintedTile a = - HT { nmaster :: Int - , delta, frac :: Rational - , orientation :: Orientation - } deriving ( Show, Read ) +data HintedTile a = HintedTile + { nmaster :: Int + , delta, frac :: Rational + , orientation :: Orientation + } deriving ( Show, Read ) data Orientation = Wide | Tall deriving ( Show, Read ) -tall, wide :: Int -> Rational -> Rational -> HintedTile Window -wide n d f = HT {nmaster = n, delta = d, frac = f, orientation = Tall } -tall n d f = HT {nmaster = n, delta = d, frac = f, orientation = Wide } - instance LayoutClass HintedTile Window where doLayout c rect w' = let w = W.integrate w' in do { hints <- sequence (map getHints w) @@ -63,8 +59,8 @@ instance LayoutClass HintedTile Window where where (split, divide) = case orientation c of - Wide -> (splitHorizontally, divideHorizontally) - Tall -> (splitVertically, divideVertically ) + Tall -> (splitHorizontally, divideVertically) + Wide -> (splitVertically, divideHorizontally) tiler b f r masters slaves = if null masters || null slaves then divide b (masters ++ slaves) r -- cgit v1.2.3