diff options
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 |