diff options
author | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 21:10:59 +0100 |
---|---|---|
committer | Spencer Janssen <sjanssen@cse.unl.edu> | 2007-11-01 21:10:59 +0100 |
commit | 4866f2e367dfcf22a9591231ba40948826a1b438 (patch) | |
tree | 7a245caee3f146826b267d773b7eaa80386a818e /Dishes.hs | |
parent | 47589e1913fb9530481caedb543978a30d4323ea (diff) | |
download | XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.gz XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.tar.xz XMonadContrib-4866f2e367dfcf22a9591231ba40948826a1b438.zip |
Hierarchify
darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz
Diffstat (limited to 'Dishes.hs')
-rw-r--r-- | Dishes.hs | 57 |
1 files changed, 0 insertions, 57 deletions
diff --git a/Dishes.hs b/Dishes.hs deleted file mode 100644 index a1eae21..0000000 --- a/Dishes.hs +++ /dev/null @@ -1,57 +0,0 @@ -{-# LANGUAGE FlexibleInstances, MultiParamTypeClasses #-} - ------------------------------------------------------------------------------ --- | --- Module : XMonadContrib.Dishes --- Copyright : (c) Jeremy Apthorp --- License : BSD-style (see LICENSE) --- --- Maintainer : Jeremy Apthorp <nornagon@gmail.com> --- Stability : unstable --- Portability : portable --- --- Dishes is a layout that stacks extra windows underneath the master --- windows. --- ------------------------------------------------------------------------------ - -module XMonadContrib.Dishes ( - -- * Usage - -- $usage - Dishes (..) - ) where - -import Data.List -import XMonad -import XMonad.Layouts -import XMonad.StackSet (integrate) -import Control.Monad (ap) -import Graphics.X11.Xlib - --- $usage --- You can use this module with the following in your Config.hs file: --- --- > import XMonadContrib.Dishes --- --- and add the following line to your 'layouts' --- --- > , Layout $ Dishes 2 (1%6) - --- %import XMonadContrib.Dishes --- %layout , Layout $ Dishes 2 (1%6) - -data Dishes a = Dishes Int Rational deriving (Show, Read) -instance LayoutClass Dishes a where - doLayout (Dishes nmaster h) r = - return . (\x->(x,Nothing)) . - ap zip (dishes h r nmaster . length) . integrate - pureMessage (Dishes nmaster h) m = fmap incmastern (fromMessage m) - where incmastern (IncMasterN d) = Dishes (max 0 (nmaster+d)) h - -dishes :: Rational -> Rectangle -> Int -> Int -> [Rectangle] -dishes h s nmaster n = if n <= nmaster - then splitHorizontally n s - else ws - where - (m,rest) = splitVerticallyBy (1 - (fromIntegral $ n - nmaster) * h) s - ws = splitHorizontally nmaster m ++ splitVertically (n - nmaster) rest |