Add gaps to gaplessgrid layout
This commit is contained in:
parent
513ae0cc68
commit
90ea92628f
|
@ -44,16 +44,16 @@ gaplessgrid(Monitor *m) {
|
|||
rows = n/cols;
|
||||
|
||||
/* window geometries */
|
||||
cw = cols ? m->ww / cols : m->ww;
|
||||
cw = cols ? (m->ww - m->gappx) / cols : m->ww - m->gappx;
|
||||
cn = 0; /* current column number */
|
||||
rn = 0; /* current row number */
|
||||
for(i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) {
|
||||
if(i/rows + 1 > cols - n%cols)
|
||||
rows = n/cols + 1;
|
||||
ch = rows ? m->wh / rows : m->wh;
|
||||
ch = rows ? (m->wh - m->gappx) / rows : m->wh - m->gappx;
|
||||
cx = m->wx + cn*cw;
|
||||
cy = m->wy + rn*ch;
|
||||
resize(c, cx, cy, cw - 2 * c->bw, ch - 2 * c->bw, False);
|
||||
resize(c, cx + m->gappx, cy + m->gappx, cw - 2 * c->bw - m->gappx, ch - 2 * c->bw - m->gappx, False);
|
||||
rn++;
|
||||
if(rn >= rows) {
|
||||
rn = 0;
|
||||
|
|
Loading…
Reference in New Issue