aboutsummaryrefslogtreecommitdiffstats
path: root/DragPane.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-10-23 15:49:11 +0200
committerDavid Roundy <droundy@darcs.net>2007-10-23 15:49:11 +0200
commit5b6f670fb3b69f103771c4042c0417c325e8d32f (patch)
tree349ce4280cdc84fb0f46beee51c4b6124f8349b0 /DragPane.hs
parentf53a726f0f9557bce7020421fca5204b85434294 (diff)
downloadXMonadContrib-5b6f670fb3b69f103771c4042c0417c325e8d32f.tar.gz
XMonadContrib-5b6f670fb3b69f103771c4042c0417c325e8d32f.tar.xz
XMonadContrib-5b6f670fb3b69f103771c4042c0417c325e8d32f.zip
make DragPane work with any type (not just Windows).
darcs-hash:20071023134911-72aca-d94c618211c707b74fa50cae1cc91606aca03262.gz
Diffstat (limited to 'DragPane.hs')
-rw-r--r--DragPane.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/DragPane.hs b/DragPane.hs
index 9a058ac..05dbd42 100644
--- a/DragPane.hs
+++ b/DragPane.hs
@@ -64,7 +64,7 @@ data DragPane a =
data DragType = Horizontal | Vertical deriving ( Show, Read )
-instance LayoutClass DragPane Window where
+instance LayoutClass DragPane a where
doLayout d@(DragPane _ Vertical _ _) = doLay id d
doLayout d@(DragPane _ Horizontal _ _) = doLay mirrorRect d
handleMessage = handleMess
@@ -72,7 +72,7 @@ instance LayoutClass DragPane Window where
data SetFrac = SetFrac Int Double deriving ( Show, Read, Eq, Typeable )
instance Message SetFrac
-handleMess :: DragPane Window -> SomeMessage -> X (Maybe (DragPane Window))
+handleMess :: DragPane a -> SomeMessage -> X (Maybe (DragPane a))
handleMess d@(DragPane mb@(I (Just (win,_,ident))) ty delta split) x
| Just e <- fromMessage x :: Maybe Event = do handleEvent d e
return Nothing
@@ -87,7 +87,7 @@ handleMess d@(DragPane mb@(I (Just (win,_,ident))) ty delta split) x
return $ Just (DragPane mb ty delta frac)
handleMess _ _ = return Nothing
-handleEvent :: DragPane Window -> Event -> X ()
+handleEvent :: DragPane a -> Event -> X ()
handleEvent (DragPane (I (Just (win,r,ident))) ty _ _)
(ButtonEvent {ev_window = thisw, ev_subwindow = thisbw, ev_event_type = t })
| t == buttonPress && thisw == win || thisbw == win = do
@@ -99,7 +99,7 @@ handleEvent (DragPane (I (Just (win,r,ident))) ty _ _)
(return ())
handleEvent _ _ = return ()
-doLay :: (Rectangle -> Rectangle) -> DragPane Window -> Rectangle -> W.Stack a -> X ([(a, Rectangle)], Maybe (DragPane a))
+doLay :: (Rectangle -> Rectangle) -> DragPane a -> Rectangle -> W.Stack a -> X ([(a, Rectangle)], Maybe (DragPane a))
doLay mirror (DragPane mw ty delta split) r s = do
let r' = mirror r
(left', right') = splitHorizontallyBy split r'