void stacked_add(Monitor* mon, Column* col, Client* c)
{
- /* TODO: unshade when client before is is removed */
/* TODO: add floating client add function */
coldims(mon, col, &(c->x), &(c->y), &(c->w), &(c->h));
if (col->clients)
for (; prev->next != c; prev = prev->next);
prev->next = c->next;
prev->h += c->h;
+ client_setshade(prev, 0);
client_adjust(prev);
}
}
void stacked_set(Monitor* mon, Column* col, Client* c)
{
- (void)mon, (void)col, (void)c;
- puts("switching to stacked mode");
- /* TODO: implement switch back to stacked mode */
+ (void)c;
+ col->focused = NULL;
+ int nclients = 0;
+ for (Client* c = col->clients->next; c; c = c->next, nclients++);
+ int starty = (mon->y + mon->h) - (nclients * MIN_HEIGHT);
+ col->clients->h = starty - mon->y - 1;
+ client_adjust(col->clients);
+ for (Client* c = col->clients->next; c; c = c->next)
+ {
+ c->y = starty;
+ c->h = MIN_HEIGHT;
+ client_setshade(c, 0);
+ client_adjust(c);
+ starty += MIN_HEIGHT;
+ }
}
void stacked_addheight(Monitor* mon, Column* col, Client* c, int amount)