aboutsummaryrefslogtreecommitdiffstats
path: root/LayoutScreens.hs
diff options
context:
space:
mode:
authorDavid Roundy <droundy@darcs.net>2007-09-23 23:59:42 +0200
committerDavid Roundy <droundy@darcs.net>2007-09-23 23:59:42 +0200
commite10ef71da054c12355f720344d4c4ca0c11b4e12 (patch)
treef28ee0c81871fca59e940a915dfa288939ad34a4 /LayoutScreens.hs
parentb9eb4934569ce7dc6c320c5ca701b3f16ae2990e (diff)
downloadXMonadContrib-e10ef71da054c12355f720344d4c4ca0c11b4e12.tar.gz
XMonadContrib-e10ef71da054c12355f720344d4c4ca0c11b4e12.tar.xz
XMonadContrib-e10ef71da054c12355f720344d4c4ca0c11b4e12.zip
convert LayoutScreens to class.
darcs-hash:20070923215942-72aca-5bba94380ce9f493e2ba3b2ff339485003562816.gz
Diffstat (limited to 'LayoutScreens.hs')
-rw-r--r--LayoutScreens.hs12
1 files changed, 8 insertions, 4 deletions
diff --git a/LayoutScreens.hs b/LayoutScreens.hs
index 578b9e9..c3de2ba 100644
--- a/LayoutScreens.hs
+++ b/LayoutScreens.hs
@@ -54,7 +54,7 @@ import Graphics.X11.Xlib.Extras
-- %keybind , ((modMask .|. shiftMask, xK_space), layoutScreens 2 (twoPane 0.5 0.5))
-- %keybind , ((controlMask .|. modMask .|. shiftMask, xK_space), rescreen)
-layoutScreens :: Int -> Layout Int -> X ()
+layoutScreens :: Layout l Int => Int -> l Int -> X ()
layoutScreens nscr _ | nscr < 1 = trace $ "Can't layoutScreens with only " ++ show nscr ++ " screens."
layoutScreens nscr l =
do rtrect <- asks theRoot >>= getWindowRectangle
@@ -73,6 +73,10 @@ getWindowRectangle w = withDisplay $ \d ->
return $ Rectangle (fromIntegral $ wa_x a) (fromIntegral $ wa_y a)
(fromIntegral $ wa_width a) (fromIntegral $ wa_height a)
-fixedLayout :: [Rectangle] -> Layout a
-fixedLayout rs = Layout { doLayout = \_ s -> return (zip (W.integrate s) rs,Nothing)
- , modifyLayout = const (return Nothing) } -- no changes
+data FixedLayout a = FixedLayout [Rectangle] deriving (Read,Show)
+
+instance Layout FixedLayout a where
+ doLayout (FixedLayout rs) _ s = return (zip (W.integrate s) rs, Nothing)
+
+fixedLayout :: [Rectangle] -> FixedLayout a
+fixedLayout = FixedLayout