Implement moving clients to the left if they are leftmost

This commit is contained in:
Michael Stapelberg
2009-03-11 01:55:10 +01:00
parent 9c0d5b6e5e
commit 49b56166dc
3 changed files with 29 additions and 5 deletions

View File

@ -85,6 +85,28 @@ void expand_table_cols(Workspace *workspace) {
new_container(workspace, &(workspace->table[workspace->cols-1][c]), workspace->cols-1, c);
}
/*
* Inserts one column at the tables head
*
*/
void expand_table_cols_at_head(Workspace *workspace) {
workspace->cols++;
workspace->table = realloc(workspace->table, sizeof(Container**) * workspace->cols);
workspace->table[workspace->cols-1] = calloc(sizeof(Container*) * workspace->rows, 1);
/* Move the other columns */
for (int rows = 0; rows < workspace->rows; rows++)
for (int cols = workspace->cols - 1; cols > 0; cols--) {
LOG("Moving col %d to %d\n", cols-1, cols);
workspace->table[cols][rows] = workspace->table[cols-1][rows];
workspace->table[cols][rows]->col = cols;
}
for (int rows = 0; rows < workspace->rows; rows++)
new_container(workspace, &(workspace->table[0][rows]), 0, rows);
}
/*
* Shrinks the table by one column.
*