From 1f4cc4074b963cc209a22fa6187ca68f799fc327 Mon Sep 17 00:00:00 2001 From: David Roundy Date: Wed, 26 Sep 2007 21:16:56 +0200 Subject: make DragPane code a bit more compact. darcs-hash:20070926191656-72aca-6a0aac4ba0240a04152c9f6b8cbe30bcb2de7f11.gz --- DragPane.hs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) (limited to 'DragPane.hs') diff --git a/DragPane.hs b/DragPane.hs index 68f6dd8..b11d663 100644 --- a/DragPane.hs +++ b/DragPane.hs @@ -71,15 +71,12 @@ instance Message SetFrac handleMess :: DragPane Window -> SomeMessage -> X (Maybe (DragPane Window)) handleMess d@(DragPane mb@(Just (win,_,ident)) ty delta split) x - | Just e <- fromMessage x :: Maybe Event = do - handleEvent d e - return Nothing - | Just Hide <- fromMessage x = do - hideDragWin win - return $ Just (DragPane mb ty delta split) - | Just ReleaseResources <- fromMessage x = do - destroyDragWin win - return $ Just (DragPane Nothing ty delta split) + | Just e <- fromMessage x :: Maybe Event = do handleEvent d e + return Nothing + | Just Hide <- fromMessage x = do hideDragWin win + return $ Just (DragPane mb ty delta split) + | Just ReleaseResources <- fromMessage x = do destroyDragWin win + return $ Just (DragPane Nothing ty delta split) -- layout specific messages | Just Shrink <- fromMessage x = return $ Just (DragPane mb ty delta (split - delta)) | Just Expand <- fromMessage x = return $ Just (DragPane mb ty delta (split + delta)) -- cgit v1.2.3