aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-11-22 05:27:20 +0100
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-11-22 05:27:20 +0100
commitb60cef63b0a1706cb556b554a194c7679aff5e4b (patch)
treec37b11e5febea22d8b163d7ae81979f93d9a2e07 /XMonad/Layout
parent066fc2eede43f9f56dd2e5b2ecb9986d2d865782 (diff)
downloadXMonadContrib-b60cef63b0a1706cb556b554a194c7679aff5e4b.tar.gz
XMonadContrib-b60cef63b0a1706cb556b554a194c7679aff5e4b.tar.xz
XMonadContrib-b60cef63b0a1706cb556b554a194c7679aff5e4b.zip
HintedTile: orientation bug fix, remove wide and tall in favor of the Tall and Wide constructors.
darcs-hash:20071122042720-a5988-fb7db804a00e8f2c4a8c845236d454aa1c76476b.gz
Diffstat (limited to 'XMonad/Layout')
-rw-r--r--XMonad/Layout/HintedTile.hs22
1 files changed, 9 insertions, 13 deletions
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