diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-09-11 21:48:00 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-09-11 21:48:00 +0200 |
commit | 29e342c4985744cc2538d85cdbb248e6dd5f5ff8 (patch) | |
tree | 123e2ce9e38de16f5e3f56989a37879da93dd96a /MetaTile/Core.hs | |
parent | f05f53f9057508ff274f5ee51b866e68fb09824a (diff) | |
download | metatile-29e342c4985744cc2538d85cdbb248e6dd5f5ff8.tar metatile-29e342c4985744cc2538d85cdbb248e6dd5f5ff8.zip |
Let the layout decide about the border width
Diffstat (limited to 'MetaTile/Core.hs')
-rw-r--r-- | MetaTile/Core.hs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/MetaTile/Core.hs b/MetaTile/Core.hs index e116ccf..5596ec3 100644 --- a/MetaTile/Core.hs +++ b/MetaTile/Core.hs @@ -291,6 +291,14 @@ readsLayout (Layout l) s = [(Layout (asTypeOf x l), rs) | (x, rs) <- reads s] -- that any 'LayoutClass' instance chooses to define. class Show (layout a) => LayoutClass layout a where + runBorderLayout :: Workspace WorkspaceId (layout a) a + -> Rectangle + -> X ([(a, Rectangle, BorderWidth)], Maybe (layout a)) + runBorderLayout ws r = do + bw <- asks (defaultBorderWidth . config) + (as, l) <- runLayout ws r + return ([(a, ar, bw) | (a, ar) <- as], l) + -- | By default, 'runLayout' calls 'doLayout' if there are any -- windows to be laid out, and 'emptyLayout' otherwise. Most -- instances of 'LayoutClass' probably do not need to implement @@ -356,6 +364,7 @@ class Show (layout a) => LayoutClass layout a where description = show instance LayoutClass Layout Window where + runBorderLayout (Workspace i (Layout l) ms) r = fmap (fmap Layout) `fmap` runBorderLayout (Workspace i l ms) r runLayout (Workspace i (Layout l) ms) r = fmap (fmap Layout) `fmap` runLayout (Workspace i l ms) r doLayout (Layout l) r s = fmap (fmap Layout) `fmap` doLayout l r s emptyLayout (Layout l) r = fmap (fmap Layout) `fmap` emptyLayout l r |