From 8fc37974a17279512fa75c64961040f1d7a82041 Mon Sep 17 00:00:00 2001 From: Adam Vogt Date: Fri, 2 Oct 2009 02:15:52 +0200 Subject: Small style change in L.SimplestFloat Ignore-this: d8be5d01d47833c70d220e0f1555c42f darcs-hash:20091002001552-1499c-7420fa180b5944e43bd8d277e2445a542d645226.gz --- XMonad/Layout/SimplestFloat.hs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'XMonad') diff --git a/XMonad/Layout/SimplestFloat.hs b/XMonad/Layout/SimplestFloat.hs index 61a3c0d..699fafa 100644 --- a/XMonad/Layout/SimplestFloat.hs +++ b/XMonad/Layout/SimplestFloat.hs @@ -23,6 +23,7 @@ import XMonad import qualified XMonad.StackSet as S import XMonad.Layout.WindowArranger import XMonad.Layout.LayoutModifier +import XMonad.Util.XUtils (fi) -- $usage -- You can use this module with the following in your @@ -42,12 +43,12 @@ import XMonad.Layout.LayoutModifier -- | A simple floating layout where every window is placed according -- to the window's initial attributes. simplestFloat :: Eq a => (ModifiedLayout WindowArranger SimplestFloat) a -simplestFloat = (windowArrangeAll $ SF) +simplestFloat = windowArrangeAll SF data SimplestFloat a = SF deriving (Show, Read) instance LayoutClass SimplestFloat Window where - doLayout SF sc (S.Stack w l r) = do wrs <- mapM (getSize sc) (w : reverse l ++ r) - return (wrs, Nothing) + doLayout SF sc (S.Stack w l r) = fmap (flip (,) Nothing) + $ mapM (getSize sc) (w : reverse l ++ r) description _ = "SimplestFloat" getSize :: Rectangle -> Window -> X (Window,Rectangle) @@ -60,5 +61,3 @@ getSize (Rectangle rx ry _ _) w = do wh = (fi $ wa_width wa) + (bw * 2) ht = (fi $ wa_height wa) + (bw * 2) return (w, Rectangle x y wh ht) - where - fi x = fromIntegral x \ No newline at end of file -- cgit v1.2.3