aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/SimpleDecoration.hs
diff options
context:
space:
mode:
authorAndrea Rossato <andrea.rossato@unibz.it>2008-02-18 14:13:20 +0100
committerAndrea Rossato <andrea.rossato@unibz.it>2008-02-18 14:13:20 +0100
commit7c7884a5d86cffaf306fde89d9d4d3a85d160d5c (patch)
tree42c84c73aadcec349f9aab86e1c0dd033c846d91 /XMonad/Layout/SimpleDecoration.hs
parent8c595555ce9d1f1d2bfce4bf0ff441d75b79b1c0 (diff)
downloadXMonadContrib-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/SimpleDecoration.hs')
-rw-r--r--XMonad/Layout/SimpleDecoration.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/XMonad/Layout/SimpleDecoration.hs b/XMonad/Layout/SimpleDecoration.hs
index 09527ed..aa5d500 100644
--- a/XMonad/Layout/SimpleDecoration.hs
+++ b/XMonad/Layout/SimpleDecoration.hs
@@ -53,16 +53,20 @@ import XMonad.Layout.Decoration
-- > myL = dwmStyle shrinkText mySDConfig (layoutHook defaultTheme)
-- | Add simple decorations to windows of a layout.
-simpleDeco :: Shrinker s => s -> Theme
+simpleDeco :: (Eq a, Shrinker s) => s -> Theme
-> l a -> ModifiedLayout (Decoration SimpleDecoration s) l a
simpleDeco s c = decoration s c $ Simple True
data SimpleDecoration a = Simple Bool deriving (Show, Read)
-instance DecorationStyle SimpleDecoration a where
+instance Eq a => DecorationStyle SimpleDecoration a where
describeDeco _ = "Simple"
shrink (Simple b) (Rectangle _ _ _ dh) r@(Rectangle x y w h) =
if b then Rectangle x (y + fi dh) w (h - dh) else r
- pureDecoration (Simple b) wh ht _ _ _ (_,Rectangle x y wid _) =
- if b then Just $ Rectangle x y nwh ht else Just $ Rectangle x (y - fi ht) nwh ht
+ pureDecoration (Simple b) wh ht _ s _ (w,Rectangle x y wid _) =
+ if isInStack s w
+ then if b
+ then Just $ Rectangle x y nwh ht
+ else Just $ Rectangle x (y - fi ht) nwh ht
+ else Nothing
where nwh = min wid wh