Delete layout_grid.c

main
kvj 2023-12-11 19:13:42 +01:00
parent e4e484966e
commit 9d55d4d9c6
1 changed files with 0 additions and 29 deletions

View File

@ -1,29 +0,0 @@
void
grid(Monitor *m)
{
unsigned int i, n;
int cx, cy, cw, ch, cc, cr, chrest, cwrest, cols, rows;
int oh, ov, ih, iv;
Client *c;
getgaps(m, &oh, &ov, &ih, &iv, &n);
/* grid dimensions */
for (rows = 0; rows <= n/2; rows++)
if (rows*rows >= n)
break;
cols = (rows && (rows - 1) * rows >= n) ? rows - 1 : rows;
/* window geoms (cell height/width) */
ch = (m->wh - 2*oh - ih * (rows - 1)) / (rows ? rows : 1);
cw = (m->ww - 2*ov - iv * (cols - 1)) / (cols ? cols : 1);
chrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows;
cwrest = (m->ww - 2*ov - iv * (cols - 1)) - cw * cols;
for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
cc = i / rows;
cr = i % rows;
cx = m->wx + ov + cc * (cw + iv) + MIN(cc, cwrest);
cy = m->wy + oh + cr * (ch + ih) + MIN(cr, chrest);
resize(c, cx, cy, cw + (cc < cwrest ? 1 : 0) - 2*c->bw, ch + (cr < chrest ? 1 : 0) - 2*c->bw, False);
}
}