aboutsummaryrefslogtreecommitdiffstats
path: root/XMonad/Layout/MultiToggle/Instances.hs
blob: b8112f178d3fe2502d361e41bb234b9a50f7874f (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
{-# LANGUAGE TypeSynonymInstances, DeriveDataTypeable, MultiParamTypeClasses #-}

-----------------------------------------------------------------------------
-- |
-- Module      :  XMonad.Layout.MultiToggle.Instances
-- Copyright   :  (c) 2008  Brent Yorgey
-- License     :  BSD-style (see LICENSE)
--
-- Maintainer  :  <byorgey@gmail.com>
-- Stability   :  unstable
-- Portability :  unportable
--
-- Some convenient common instances of the
-- 'XMonad.Layout.MultiToggle.Transformer' class, for use with
-- "XMonad.Layout.MultiToggle".

module XMonad.Layout.MultiToggle.Instances (
  StdTransformers(..)
) where

import XMonad.Layout.MultiToggle

import XMonad
import XMonad.Layout.NoBorders
import XMonad.Layout.LayoutModifier

data StdTransformers = FULL          -- ^ switch to Full layout
                     | NBFULL        -- ^ switch to Full with no borders
                     | MIRROR        -- ^ Mirror the current layout.
                     | NOBORDERS     -- ^ Remove borders.
                     | SMARTBORDERS  -- ^ Apply smart borders.
  deriving (Read, Show, Eq, Typeable)

instance Transformer StdTransformers Window where
    transform FULL         x k = k Full (const x)
    transform NBFULL       x k = k (noBorders Full) (const x)
    transform MIRROR       x k = k (Mirror x) (\(Mirror x') -> x')
    transform NOBORDERS    x k = k (noBorders x) (\(ModifiedLayout _ x') -> x')
    transform SMARTBORDERS x k = k (smartBorders x) (\(ModifiedLayout _ x') -> x')