mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-05-19 11:30:22 -07:00
Dishes: tabs
This commit is contained in:
parent
ea8cd6d2c7
commit
1f698321d7
22
Dishes.hs
22
Dishes.hs
@ -17,7 +17,7 @@
|
||||
|
||||
module XMonadContrib.Dishes (
|
||||
-- * Usage
|
||||
-- $usage
|
||||
-- $usage
|
||||
Dishes (..)
|
||||
) where
|
||||
|
||||
@ -42,16 +42,16 @@ import Graphics.X11.Xlib
|
||||
|
||||
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
|
||||
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
|
||||
then splitHorizontally n s
|
||||
else ws
|
||||
where
|
||||
(m,rest) = splitVerticallyBy (1 - (fromIntegral $ n - nmaster) * h) s
|
||||
ws = splitHorizontally nmaster m ++ splitVertically (n - nmaster) rest
|
||||
|
Loading…
x
Reference in New Issue
Block a user