diff options
author | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 14:13:20 +0100 |
---|---|---|
committer | Andrea Rossato <andrea.rossato@unibz.it> | 2008-02-18 14:13:20 +0100 |
commit | 7c7884a5d86cffaf306fde89d9d4d3a85d160d5c (patch) | |
tree | 42c84c73aadcec349f9aab86e1c0dd033c846d91 /XMonad/Layout/DecorationMadness.hs | |
parent | 8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0 (diff) | |
download | XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.tar.gz XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.tar.xz XMonadContrib-7c7884a5d86cffaf306fde89d9d4d3a85d160d5c.zip |
add Eq superclass to DecorationStyle and change styles in order not to decorate non managed windows
darcs-hash:20080218131320-32816-44ecfbd0dca9eb353a569898deefebef9f7088ed.gz
Diffstat (limited to 'XMonad/Layout/DecorationMadness.hs')
-rw-r--r-- | XMonad/Layout/DecorationMadness.hs | 12 |
1 files changed, 7 insertions, 5 deletions
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: -- -- <http://code.haskell.org/~arossato/xmonadShots/floatSimpleSimple.png> -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: -- -- <http://code.haskell.org/~arossato/xmonadShots/floatSimpleDefault.png> -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)) |