From 03e5ae0446142c78b6c26e9b0e1ac76fb1dcbc97 Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Mon, 28 Jan 2008 17:06:14 +0100 Subject: LayoutModifier: add modifyDescription for completely override the modified layout description darcs-hash:20080128160614-32816-0bb2e8e13a656887e5376405f866190874e050ab.gz --- XMonad/Layout/LayoutModifier.hs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'XMonad/Layout/LayoutModifier.hs') 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 ) -- cgit v1.2.3