diff options
author | Norbert Zeh <nzeh@cs.dal.ca> | 2009-12-15 20:21:42 +0100 |
---|---|---|
committer | Norbert Zeh <nzeh@cs.dal.ca> | 2009-12-15 20:21:42 +0100 |
commit | 7d74e99e143a2a6ead7cb754e02273c10c848757 (patch) | |
tree | 5ce17fe6bdd291a622b53322cbf40290e1b01f19 | |
parent | 1187eaf3b7e63523b7ad9bd287038baef3bedfa9 (diff) | |
download | XMonadContrib-7d74e99e143a2a6ead7cb754e02273c10c848757.tar.gz XMonadContrib-7d74e99e143a2a6ead7cb754e02273c10c848757.tar.xz XMonadContrib-7d74e99e143a2a6ead7cb754e02273c10c848757.zip |
Additional messages for SplitGrid layout
Ignore-this: eb945168d1c420e5a9ed87da12a7acf8
This patch introduces two new message SetMasterRows and SetMasterCols for the
X.GridVariants.SplitGrid layout, which set the number of rows/columns in the
master grid to the given value. This is useful when setting the number of rows
and/or columns non-incrementally using an interface such as GridSelect.
darcs-hash:20091215192142-18a2b-ab6e52541551341405cba967a775252e83d4ce7f.gz
-rw-r--r-- | XMonad/Layout/GridVariants.hs | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/XMonad/Layout/GridVariants.hs b/XMonad/Layout/GridVariants.hs index 69e97a2..e363c89 100644 --- a/XMonad/Layout/GridVariants.hs +++ b/XMonad/Layout/GridVariants.hs @@ -104,6 +104,8 @@ instance LayoutClass SplitGrid a where data ChangeMasterGeom = IncMasterRows !Int -- ^Change the number of master rows | IncMasterCols !Int -- ^Change the number of master columns + | SetMasterRows !Int -- ^Set the number of master rows to absolute value + | SetMasterCols !Int -- ^Set the number of master columns to absolute value deriving Typeable instance Message ChangeMasterGeom @@ -188,6 +190,10 @@ changeMasterGrid (SplitGrid o mrows mcols mfrac saspect delta) (IncMasterRows d) SplitGrid o (max 0 (mrows + d)) mcols mfrac saspect delta changeMasterGrid (SplitGrid o mrows mcols mfrac saspect delta) (IncMasterCols d) = SplitGrid o mrows (max 0 (mcols + d)) mfrac saspect delta +changeMasterGrid (SplitGrid o _ mcols mfrac saspect delta) (SetMasterRows mrows) = + SplitGrid o (max 0 mrows) mcols mfrac saspect delta +changeMasterGrid (SplitGrid o mrows _ mfrac saspect delta) (SetMasterCols mcols) = + SplitGrid o mrows (max 0 mcols) mfrac saspect delta -- | TallGrid layout. Parameters are -- |