From 448b7d5258f79ca1ce59ef6d00861eb32f5a48f3 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Sun, 10 Jun 2007 21:57:43 +0200 Subject: color focussed tab differently. darcs-hash:20070610195743-72aca-fcc3b7023c3379b10d68050a4a68d753f7a0aab5.gz --- Tabbed.hs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'Tabbed.hs') diff --git a/Tabbed.hs b/Tabbed.hs index 2cca048..139a8d3 100644 --- a/Tabbed.hs +++ b/Tabbed.hs @@ -11,11 +11,13 @@ module XMonadContrib.Tabbed ( tabbed ) where -- , ... ] import Control.Monad ( forM ) +import Control.Monad.State ( gets ) import Graphics.X11.Xlib import XMonad import XMonadContrib.Decoration import Operations ( focus ) +import qualified StackSet as W import XMonadContrib.NamedWindows @@ -27,9 +29,14 @@ dolay sc [w] = return [(w,sc)] dolay sc@(Rectangle x _ wid _) ws = do let ts = gentabs x wid (length ws) tws = zip ts ws - maketab (t,w) = newDecoration t 1 0xFF0000 0x00FFFF (drawtab t w) (focus w) - drawtab r w d w' gc = + maketab (t,w) = newDecoration t 1 0x000000 0x00FFFF (drawtab t w) (focus w) + drawtab r@(Rectangle _ _ wt ht) w d w' gc = do nw <- getName w + focusw <- gets (W.focus . W.stack . W.workspace . W.current . windowset) + let tabcolor = if focusw == w then 0xBBBBBB else 0x888888 + io $ setForeground d gc tabcolor + io $ fillRectangles d w' gc [Rectangle 0 0 wt ht] + io $ setForeground d gc 0x000000 centerText d w' gc r (show nw) centerText d w' gc (Rectangle _ _ wt ht) name = do font <- io (fontFromGC d gc >>= queryFont d) -- cgit v1.2.3