From 4866f2e367dfcf22a9591231ba40948826a1b438 Mon Sep 17 00:00:00 2001 From: Spencer Janssen Date: Thu, 1 Nov 2007 21:10:59 +0100 Subject: Hierarchify darcs-hash:20071101201059-a5988-fc1f1262bec1b69e13ba18ae7cefeafc8c4471d4.gz --- Dishes.hs | 57 --------------------------------------------------------- 1 file changed, 57 deletions(-) delete mode 100644 Dishes.hs (limited to 'Dishes.hs') 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 --- 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 -- cgit v1.2.3