aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2008-01-28 17:06:14 +0100
committerAndrea Rossato <andrea.rossato@unibz.it>2008-01-28 17:06:14 +0100
commit03e5ae0446142c78b6c26e9b0e1ac76fb1dcbc97 (patch)
treea87e645cbf721efeb2d617bcb63a11990d64d708
parentae4e33e3af57f0a255d7552fbafa0a0fb607f7dd (diff)
downloadXMonadContrib-03e5ae0446142c78b6c26e9b0e1ac76fb1dcbc97.tar.gz
XMonadContrib-03e5ae0446142c78b6c26e9b0e1ac76fb1dcbc97.tar.xz
XMonadContrib-03e5ae0446142c78b6c26e9b0e1ac76fb1dcbc97.zip
LayoutModifier: add modifyDescription for completely override the modified layout description
darcs-hash:20080128160614-32816-0bb2e8e13a656887e5376405f866190874e050ab.gz
-rw-r--r--XMonad/Layout/LayoutModifier.hs8
1 files changed, 5 insertions, 3 deletions
diff --git a/XMonad/Layout/LayoutModifier.hs b/XMonad/Layout/LayoutModifier.hs
index 46cabd6..d92f6c4 100644
--- a/XMonad/Layout/LayoutModifier.hs
+++ b/XMonad/Layout/LayoutModifier.hs
@@ -61,6 +61,10 @@ class (Show (m a), Read (m a)) => LayoutModifier m a where
unhook _ = return ()
modifierDescription :: m a -> String
modifierDescription = const ""
+ modifyDescription :: (LayoutClass l a) => m a -> l a -> String
+ modifyDescription m l = modifierDescription m <> description l
+ where "" <> x = x
+ x <> y = x ++ " " ++ y
instance (LayoutModifier m a, LayoutClass l a) => LayoutClass (ModifiedLayout m l) a where
doLayout (ModifiedLayout m l) r s =
@@ -85,8 +89,6 @@ instance (LayoutModifier m a, LayoutClass l a) => LayoutClass (ModifiedLayout m
return $ case mm' of
Just (Left m') -> Just $ (ModifiedLayout m') $ maybe l id ml'
_ -> (ModifiedLayout m) `fmap` ml'
- description (ModifiedLayout m l) = modifierDescription m <> description l
- where "" <> x = x
- x <> y = x ++ " " ++ y
+ description (ModifiedLayout m l) = modifyDescription m l
data ModifiedLayout m l a = ModifiedLayout (m a) (l a) deriving ( Read, Show )