From 1b5e7b626dd6d15c38aaa6555ab72740be58a8bf Mon Sep 17 00:00:00 2001 From: Jason Creighton Date: Wed, 27 Jun 2007 05:39:10 +0200 Subject: Tabbed: Make use of the Stack to get focused window darcs-hash:20070627033910-b9aa7-0c9dd49af1c853ac608f8b7b368febe687d7343d.gz --- Tabbed.hs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'Tabbed.hs') diff --git a/Tabbed.hs b/Tabbed.hs index efb91d8..48205d9 100644 --- a/Tabbed.hs +++ b/Tabbed.hs @@ -20,8 +20,7 @@ module XMonadContrib.Tabbed ( , TConf (..), defaultTConf ) where -import Control.Monad ( forM, liftM ) -import Control.Monad.State ( gets ) +import Control.Monad ( forM ) import Graphics.X11.Xlib import XMonad @@ -86,7 +85,7 @@ dolay shr conf sc@(Rectangle x y wid _) s = withDisplay $ \dpy -> maketab (t,ow) = newDecoration ow t 1 bgcolor activecolor (fontName conf) (drawtab t ow) (focus ow) drawtab r@(Rectangle _ _ wt ht) ow d w' gc fn = do nw <- getName ow - tabcolor <- (maybe inactivecolor (\focusw -> if focusw == ow then activecolor else inactivecolor) . W.peek) `liftM` gets windowset + let tabcolor = if W.focus s == ow then activecolor else inactivecolor io $ setForeground d gc tabcolor io $ fillRectangles d w' gc [Rectangle 0 0 wt ht] io $ setForeground d gc textcolor @@ -100,7 +99,7 @@ dolay shr conf sc@(Rectangle x y wid _) s = withDisplay $ \dpy -> (fromIntegral (wt `div` 2) - fromIntegral (width `div` 2)) ((fromIntegral ht + fromIntegral asc) `div` 2) name' forM tws maketab - return $ map (\w -> (w,shrink conf sc)) ws + return [(W.focus s, shrink conf sc)] type Shrinker = String -> [String] -- cgit v1.2.3