Closes issue #222.

This commit is contained in:
Kris Maglione 2011-09-19 16:25:11 -04:00
parent d40f0a0c10
commit ecaa8861c1
2 changed files with 24 additions and 1 deletions

View File

@ -72,6 +72,18 @@ column_minwidth(void)
return 4 * labelh(def.font);
}
static void
columns_update(View *v) {
Area *a;
Frame *f;
int s;
foreach_frame(v, s, a, f) {
f->screen = s;
f->column = area_idx(a);
}
}
Area*
column_new(View *v, Area *pos, int scrn, uint w) {
Area *a;
@ -84,6 +96,7 @@ column_new(View *v, Area *pos, int scrn, uint w) {
return nil;
view_arrange(v);
columns_update(v);
view_update(v);
#endif
}
@ -101,6 +114,15 @@ column_insert(Area *a, Frame *f, Frame *pos) {
area_setsel(a, f);
}
void
column_destroy(Area *a) {
View *v;
v = a->view;
area_destroy(a);
columns_update(v);
}
void
column_attach(Area *a, Frame *f) {
Frame *first;
@ -135,7 +157,7 @@ column_detach(Frame *f) {
stack_scale(first, dy);
column_arrange(a, false);
}else if(a->view->areas[a->screen]->next)
area_destroy(a);
column_destroy(a);
}
static void column_scale(Area*);

View File

@ -113,6 +113,7 @@ char* column_getmode(Area*);
void column_arrange(Area*, bool dirty);
void column_attach(Area*, Frame*);
void column_attachrect(Area*, Frame*, Rectangle);
void column_destroy(Area*);
void column_detach(Frame*);
void column_frob(Area*);
void column_insert(Area*, Frame*, Frame*);