aboutsummaryrefslogtreecommitdiffstats
path: root/Tabbed.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-06-10 21:57:43 +0200
committerDavid Roundy <droundy@darcs.net>2007-06-10 21:57:43 +0200
commit448b7d5258f79ca1ce59ef6d00861eb32f5a48f3 (patch)
treea2f072aad6b62d61ac697b8974d8eeabbf0c6ce4 /Tabbed.hs
parent58028d487b7963fe6e5154f89b18d0f37e7c96ee (diff)
downloadXMonadContrib-448b7d5258f79ca1ce59ef6d00861eb32f5a48f3.tar.gz
XMonadContrib-448b7d5258f79ca1ce59ef6d00861eb32f5a48f3.tar.xz
XMonadContrib-448b7d5258f79ca1ce59ef6d00861eb32f5a48f3.zip
color focussed tab differently.
darcs-hash:20070610195743-72aca-fcc3b7023c3379b10d68050a4a68d753f7a0aab5.gz
Diffstat (limited to 'Tabbed.hs')
-rw-r--r--Tabbed.hs11
1 files changed, 9 insertions, 2 deletions
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)