aboutsummaryrefslogtreecommitdiffstats
path: root/Tabbed.hs
diff options
context:
space:
mode:
authorSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 20:34:39 +0200
committerSpencer Janssen <sjanssen@cse.unl.edu>2007-06-11 20:34:39 +0200
commitaa7b17533695687a9c31070f5d9845c52493856e (patch)
tree2045589e106c7bba57778278ebce9e7d5e8c8d8c /Tabbed.hs
parentbb778e7d5c38e5d68d350e11c61f0055000724c6 (diff)
downloadXMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.tar.gz
XMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.tar.xz
XMonadContrib-aa7b17533695687a9c31070f5d9845c52493856e.zip
Updates to work with recent API changes
darcs-hash:20070611183439-a5988-c3d6cc194fa83f012ab49d6d79130ff459dcdfe1.gz
Diffstat (limited to 'Tabbed.hs')
-rw-r--r--Tabbed.hs11
1 files changed, 6 insertions, 5 deletions
diff --git a/Tabbed.hs b/Tabbed.hs
index c85f224..106afa8 100644
--- a/Tabbed.hs
+++ b/Tabbed.hs
@@ -24,10 +24,11 @@ import XMonadContrib.NamedWindows
tabbed :: Layout
tabbed = Layout { doLayout = dolay, modifyLayout = const (return Nothing) }
-dolay :: Rectangle -> [Window] -> X [(Window, Rectangle)]
-dolay sc [w] = return [(w,sc)]
-dolay sc@(Rectangle x y wid _) ws =
- do let ts = gentabs x y wid (length ws)
+dolay :: Rectangle -> W.Stack Window -> X [(Window, Rectangle)]
+dolay sc (W.Node w [] []) = return [(w,sc)]
+dolay sc@(Rectangle x y wid _) s@(W.Node w _ _) =
+ do let ws = W.integrate s
+ ts = gentabs x y wid (length ws)
tws = zip ts ws
maketab (t,w) = newDecoration w t 1 0x000000 0x777777 (drawtab t w) (focus w)
drawtab r@(Rectangle _ _ wt ht) w d w' gc =
@@ -48,7 +49,7 @@ dolay sc@(Rectangle x y wid _) ws =
(fromIntegral (wt `div` 2) - fromIntegral (namew `div` 2))
(fromIntegral (ht `div` 2) + fromIntegral (nameh `div` 2)) name
forM tws maketab
- return [ (w,shrink sc) | w <- ws ]
+ return [ (w,shrink sc) ]
shrink :: Rectangle -> Rectangle
shrink (Rectangle x y w h) = Rectangle x (y+tabsize) w (h-tabsize)