diff options
author | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-09-15 11:45:35 +0200 |
---|---|---|
committer | Matthias Schiffer <mschiffer@universe-factory.net> | 2013-09-15 11:45:35 +0200 |
commit | 0cc73f01c0b47632b78cc0489847493b1f1186fe (patch) | |
tree | 68b114a7aa4417a204a269a97414a17b9c43c504 | |
parent | fb21813a5ccb7208672d84e85b064cb853373c04 (diff) | |
download | metatile-0cc73f01c0b47632b78cc0489847493b1f1186fe.tar metatile-0cc73f01c0b47632b78cc0489847493b1f1186fe.zip |
Add border support to default meta-layouts
-rw-r--r-- | MetaTile/Layout.hs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/MetaTile/Layout.hs b/MetaTile/Layout.hs index 47fd4f9..93b9408 100644 --- a/MetaTile/Layout.hs +++ b/MetaTile/Layout.hs @@ -118,8 +118,8 @@ splitVerticallyBy f = (mirrorRect *** mirrorRect) . splitHorizontallyBy f . mirr newtype Mirror l a = Mirror (l a) deriving (Show, Read) instance LayoutClass l a => LayoutClass (Mirror l) a where - runLayout (W.Workspace i (Mirror l) ms) r = (map (second mirrorRect) *** fmap Mirror) - `fmap` runLayout (W.Workspace i l ms) (mirrorRect r) + runBorderLayout (W.Workspace i (Mirror l) ms) r = (map (\(w, r', bw) -> (w, mirrorRect r', bw)) *** fmap Mirror) + `fmap` runBorderLayout (W.Workspace i l ms) (mirrorRect r) handleMessage (Mirror l) = fmap (fmap Mirror) . handleMessage l description (Mirror l) = "Mirror "++ description l @@ -172,10 +172,10 @@ choose (Choose d l r) d' ml mr = f lr hide x = fmap (fromMaybe x) $ handle x Hide instance (LayoutClass l a, LayoutClass r a) => LayoutClass (Choose l r) a where - runLayout (W.Workspace i (Choose L l r) ms) = - fmap (second . fmap $ flip (Choose L) r) . runLayout (W.Workspace i l ms) - runLayout (W.Workspace i (Choose R l r) ms) = - fmap (second . fmap $ Choose R l) . runLayout (W.Workspace i r ms) + runBorderLayout (W.Workspace i (Choose L l r) ms) = + fmap (second . fmap $ flip (Choose L) r) . runBorderLayout (W.Workspace i l ms) + runBorderLayout (W.Workspace i (Choose R l r) ms) = + fmap (second . fmap $ Choose R l) . runBorderLayout (W.Workspace i r ms) description (Choose L l _) = description l description (Choose R _ r) = description r |