diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-30 21:17:06 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2009-04-30 21:17:06 +0000 |
commit | 044e6f766017cb065fdd4f8db492e1b29cd8b87d (patch) | |
tree | cf7694b60ada53e488cd34e110857060dc533384 /layout.c | |
parent | a6f2d8233569b4dcb6e26935b33b20f796ce958c (diff) |
previous-layout command.
Diffstat (limited to 'layout.c')
-rw-r--r-- | layout.c | 17 |
1 files changed, 16 insertions, 1 deletions
@@ -1,4 +1,4 @@ -/* $Id: layout.c,v 1.4 2009-04-30 16:27:29 nicm Exp $ */ +/* $Id: layout.c,v 1.5 2009-04-30 21:17:06 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott <nicm@users.sourceforge.net> @@ -62,6 +62,21 @@ layout_next(struct window *w) } void +layout_previous(struct window *w) +{ + if (w->layout == 0) + w->layout = nitems(layouts) - 1; + else + w->layout--; + if (w->layout == 0) { + /* XXX Special-case manual. */ + window_fit_panes(w); + window_update_panes(w); + } + layout_refresh(w, 0); +} + +void layout_refresh(struct window *w, unused int active_changed) { layouts[w->layout].fn(w, active_changed); |