aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad
diff options
context:
space:
mode:
authorClemens Fruhwirth <clemens@endorphin.org>2010-10-16 23:25:59 +0200
committerClemens Fruhwirth <clemens@endorphin.org>2010-10-16 23:25:59 +0200
commit4d1dd4f341d876c7fa7a2738585855cb4e5e8fc1 (patch)
tree916d2b5df0fbc0cf097296706f85a7e849295cf3 /XMonad
parent8e72968a2ce3d378f722d68d937cd9a719a1a789 (diff)
downloadXMonadContrib-4d1dd4f341d876c7fa7a2738585855cb4e5e8fc1.tar.gz
XMonadContrib-4d1dd4f341d876c7fa7a2738585855cb4e5e8fc1.tar.xz
XMonadContrib-4d1dd4f341d876c7fa7a2738585855cb4e5e8fc1.zip
Introduce grayoutAllElements in X.A.GridSelect
Ignore-this: 78ca0416b12a49965db876c77e02387f darcs-hash:20101016212559-ed0c4-081f1b143a7935f5e1336442c78cf0654c357fe9.gz
Diffstat (limited to 'XMonad')
-rw-r--r--XMonad/Actions/GridSelect.hs14
1 files changed, 13 insertions, 1 deletions
diff --git a/XMonad/Actions/GridSelect.hs b/XMonad/Actions/GridSelect.hs
index c83de8b..91735ed 100644
--- a/XMonad/Actions/GridSelect.hs
+++ b/XMonad/Actions/GridSelect.hs
@@ -280,8 +280,20 @@ updateAllElements =
state <- get
updateElements (td_elementmap state)
+grayoutAllElements :: TwoD a ()
+grayoutAllElements =
+ do
+ state <- get
+ updateElementsWithColorizer grayOnly (td_elementmap state)
+ where grayOnly _ _ = return ("#808080", "#808080")
+
updateElements :: TwoDElementMap a -> TwoD a ()
updateElements elementmap = do
+ state <- get
+ updateElementsWithColorizer (gs_colorizer (td_gsconfig state)) elementmap
+
+updateElementsWithColorizer :: (a -> Bool -> X (String, String)) -> TwoDElementMap a -> TwoD a ()
+updateElementsWithColorizer colorizer elementmap = do
TwoDState { td_curpos = curpos,
td_drawingWin = win,
td_gsconfig = gsconfig,
@@ -293,7 +305,7 @@ updateElements elementmap = do
paneX' = div (paneX-cellwidth) 2
paneY' = div (paneY-cellheight) 2
updateElement (pos@(x,y),(text, element)) = liftX $ do
- colors <- gs_colorizer gsconfig element (pos == curpos)
+ colors <- colorizer element (pos == curpos)
drawWinBox win font
colors
cellheight