From 7c7884a5d86cffaf306fde89d9d4d3a85d160d5c Mon Sep 17 00:00:00 2001 From: Andrea Rossato Date: Mon, 18 Feb 2008 14:13:20 +0100 Subject: add Eq superclass to DecorationStyle and change styles in order not to decorate non managed windows darcs-hash:20080218131320-32816-44ecfbd0dca9eb353a569898deefebef9f7088ed.gz --- XMonad/Layout/DecorationMadness.hs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'XMonad/Layout/DecorationMadness.hs') diff --git a/XMonad/Layout/DecorationMadness.hs b/XMonad/Layout/DecorationMadness.hs index e4a771c..7c4c23b 100644 --- a/XMonad/Layout/DecorationMadness.hs +++ b/XMonad/Layout/DecorationMadness.hs @@ -84,6 +84,7 @@ module XMonad.Layout.DecorationMadness , floatSimpleTabbed , floatTabbed , defaultTheme, shrinkText + , SimpleTabbedDecoration (..) ) where import Data.List @@ -146,7 +147,8 @@ instance Eq a => DecorationStyle SimpleTabbedDecoration a where decorateFirst _ = True shrink _ _ r = r decorationMouseDragHook _ _ _ = return () - pureDecoration _ _ ht (Rectangle x y wh _) s wrs (w,_) = Just $ Rectangle nx y nwh (fi ht) + pureDecoration _ _ ht (Rectangle x y wh _) s wrs (w,_) = + if isInStack s w then Just $ Rectangle nx y nwh (fi ht) else Nothing where nwh = wh `div` max 1 (fi $ length wrs) nx = case w `elemIndex` (S.integrate s) of Just i -> x + (fi nwh * fi i) @@ -561,11 +563,11 @@ mirrorTallTabbed s t = decoration s t SimpleTabbed (resizeVertical (fi $ decoHei -- Here you can find a screen shot: -- -- -floatSimpleSimple :: ModifiedLayout (Decoration SimpleDecoration DefaultShrinker) +floatSimpleSimple :: Eq a => ModifiedLayout (Decoration SimpleDecoration DefaultShrinker) (ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a floatSimpleSimple = simpleFloat -floatSimple :: Shrinker s => s -> Theme -> +floatSimple :: (Eq a, Shrinker s) => s -> Theme -> ModifiedLayout (Decoration SimpleDecoration s) (ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a floatSimple = simpleFloat' @@ -575,13 +577,13 @@ floatSimple = simpleFloat' -- Here you can find a screen shot: -- -- -floatSimpleDefault :: ModifiedLayout (Decoration DefaultDecoration DefaultShrinker) +floatSimpleDefault :: Eq a => ModifiedLayout (Decoration DefaultDecoration DefaultShrinker) (ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a floatSimpleDefault = decoration shrinkText defaultTheme DefaultDecoration (mouseResize $ windowArrangeAll $ SF 20) -- | Same as 'floatSimpleDefault', but with the possibility of setting a -- custom shrinker and a custom theme. -floatDefault :: Shrinker s => s -> Theme -> +floatDefault :: (Eq a, Shrinker s) => s -> Theme -> ModifiedLayout (Decoration DefaultDecoration s) (ModifiedLayout MouseResize (ModifiedLayout WindowArranger SimpleFloat)) a floatDefault s c = decoration s c DefaultDecoration (mouseResize $ windowArrangeAll $ SF (decoHeight c)) -- cgit v1.2.3