mirror of
https://github.com/xmonad/xmonad-contrib.git
synced 2025-08-01 12:41:52 -07:00
Small style change in L.SimplestFloat
This commit is contained in:
@@ -23,6 +23,7 @@ import XMonad
|
|||||||
import qualified XMonad.StackSet as S
|
import qualified XMonad.StackSet as S
|
||||||
import XMonad.Layout.WindowArranger
|
import XMonad.Layout.WindowArranger
|
||||||
import XMonad.Layout.LayoutModifier
|
import XMonad.Layout.LayoutModifier
|
||||||
|
import XMonad.Util.XUtils (fi)
|
||||||
|
|
||||||
-- $usage
|
-- $usage
|
||||||
-- You can use this module with the following in your
|
-- 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
|
-- | A simple floating layout where every window is placed according
|
||||||
-- to the window's initial attributes.
|
-- to the window's initial attributes.
|
||||||
simplestFloat :: Eq a => (ModifiedLayout WindowArranger SimplestFloat) a
|
simplestFloat :: Eq a => (ModifiedLayout WindowArranger SimplestFloat) a
|
||||||
simplestFloat = (windowArrangeAll $ SF)
|
simplestFloat = windowArrangeAll SF
|
||||||
|
|
||||||
data SimplestFloat a = SF deriving (Show, Read)
|
data SimplestFloat a = SF deriving (Show, Read)
|
||||||
instance LayoutClass SimplestFloat Window where
|
instance LayoutClass SimplestFloat Window where
|
||||||
doLayout SF sc (S.Stack w l r) = do wrs <- mapM (getSize sc) (w : reverse l ++ r)
|
doLayout SF sc (S.Stack w l r) = fmap (flip (,) Nothing)
|
||||||
return (wrs, Nothing)
|
$ mapM (getSize sc) (w : reverse l ++ r)
|
||||||
description _ = "SimplestFloat"
|
description _ = "SimplestFloat"
|
||||||
|
|
||||||
getSize :: Rectangle -> Window -> X (Window,Rectangle)
|
getSize :: Rectangle -> Window -> X (Window,Rectangle)
|
||||||
@@ -60,5 +61,3 @@ getSize (Rectangle rx ry _ _) w = do
|
|||||||
wh = (fi $ wa_width wa) + (bw * 2)
|
wh = (fi $ wa_width wa) + (bw * 2)
|
||||||
ht = (fi $ wa_height wa) + (bw * 2)
|
ht = (fi $ wa_height wa) + (bw * 2)
|
||||||
return (w, Rectangle x y wh ht)
|
return (w, Rectangle x y wh ht)
|
||||||
where
|
|
||||||
fi x = fromIntegral x
|
|
Reference in New Issue
Block a user