mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-06 06:51:55 -07:00
Introduce grayoutAllElements in X.A.GridSelect
This commit is contained in:
@@ -280,8 +280,20 @@ updateAllElements =
|
|||||||
state <- get
|
state <- get
|
||||||
updateElements (td_elementmap state)
|
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 :: TwoDElementMap a -> TwoD a ()
|
||||||
updateElements elementmap = do
|
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,
|
TwoDState { td_curpos = curpos,
|
||||||
td_drawingWin = win,
|
td_drawingWin = win,
|
||||||
td_gsconfig = gsconfig,
|
td_gsconfig = gsconfig,
|
||||||
@@ -293,7 +305,7 @@ updateElements elementmap = do
|
|||||||
paneX' = div (paneX-cellwidth) 2
|
paneX' = div (paneX-cellwidth) 2
|
||||||
paneY' = div (paneY-cellheight) 2
|
paneY' = div (paneY-cellheight) 2
|
||||||
updateElement (pos@(x,y),(text, element)) = liftX $ do
|
updateElement (pos@(x,y),(text, element)) = liftX $ do
|
||||||
colors <- gs_colorizer gsconfig element (pos == curpos)
|
colors <- colorizer element (pos == curpos)
|
||||||
drawWinBox win font
|
drawWinBox win font
|
||||||
colors
|
colors
|
||||||
cellheight
|
cellheight
|
||||||
|
Reference in New Issue
Block a user