Fixed the Windows grid code. Now it's time for the OS X code (giant bottle of alcohol here).
This commit is contained in:
parent
554221fd66
commit
662c9de179
|
@ -162,9 +162,9 @@ static void gridRelayout(uiGrid *g)
|
||||||
for (i = 0; i < g->children->size(); i++) {
|
for (i = 0; i < g->children->size(); i++) {
|
||||||
gc = (*(g->children))[i];
|
gc = (*(g->children))[i];
|
||||||
if (gc->hexpand && gc->xspan == 1)
|
if (gc->hexpand && gc->xspan == 1)
|
||||||
ld->hexpand[gc->left] = true;
|
ld->hexpand[toxindex(g, gc->left)] = true;
|
||||||
if (gc->vexpand && gc->yspan == 1)
|
if (gc->vexpand && gc->yspan == 1)
|
||||||
ld->vexpand[gc->top] = true;
|
ld->vexpand[toyindex(g, gc->top)] = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 3) figure out which rows/columns expand that do span
|
// 3) figure out which rows/columns expand that do span
|
||||||
|
@ -175,25 +175,25 @@ static void gridRelayout(uiGrid *g)
|
||||||
bool doit = true;
|
bool doit = true;
|
||||||
|
|
||||||
for (ix = gc->left; ix < gc->left + gc->xspan; ix++)
|
for (ix = gc->left; ix < gc->left + gc->xspan; ix++)
|
||||||
if (ld->hexpand[ix]) {
|
if (ld->hexpand[toxindex(g, ix)]) {
|
||||||
doit = false;
|
doit = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (doit)
|
if (doit)
|
||||||
for (ix = gc->left; ix < gc->left + gc->xspan; ix++)
|
for (ix = gc->left; ix < gc->left + gc->xspan; ix++)
|
||||||
ld->hexpand[ix] = true;
|
ld->hexpand[toxindex(g, ix)] = true;
|
||||||
}
|
}
|
||||||
if (gc->vexpand && gc->yspan != 1) {
|
if (gc->vexpand && gc->yspan != 1) {
|
||||||
bool doit = true;
|
bool doit = true;
|
||||||
|
|
||||||
for (iy = gc->top; iy < gc->top + gc->yspan; iy++)
|
for (iy = gc->top; iy < gc->top + gc->yspan; iy++)
|
||||||
if (ld->vexpand[iy]) {
|
if (ld->vexpand[toyindex(g, iy)]) {
|
||||||
doit = false;
|
doit = false;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (doit)
|
if (doit)
|
||||||
for (iy = gc->top; iy < gc->top + gc->yspan; iy++)
|
for (iy = gc->top; iy < gc->top + gc->yspan; iy++)
|
||||||
ld->vexpand[iy] = true;
|
ld->vexpand[toyindex(g, iy)] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -228,7 +228,7 @@ static void gridRelayout(uiGrid *g)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 6) compute cell positions and sizes
|
// 6) compute cell positions and sizes
|
||||||
for (iy = 0; iy < ycount(g); y++) {
|
for (iy = 0; iy < ycount(g); iy++) {
|
||||||
intmax_t curx;
|
intmax_t curx;
|
||||||
int prev;
|
int prev;
|
||||||
|
|
||||||
|
@ -238,7 +238,7 @@ static void gridRelayout(uiGrid *g)
|
||||||
i = ld->gg[iy][ix];
|
i = ld->gg[iy][ix];
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
gc = (*(g->children))[i];
|
gc = (*(g->children))[i];
|
||||||
if (iy == gc->top) { // don't repeat this step if the control spans vertically
|
if (iy == toyindex(g, gc->top)) { // don't repeat this step if the control spans vertically
|
||||||
if (i != prev)
|
if (i != prev)
|
||||||
gc->finalx = curx;
|
gc->finalx = curx;
|
||||||
else
|
else
|
||||||
|
@ -260,7 +260,7 @@ static void gridRelayout(uiGrid *g)
|
||||||
i = ld->gg[iy][ix];
|
i = ld->gg[iy][ix];
|
||||||
if (i != -1) {
|
if (i != -1) {
|
||||||
gc = (*(g->children))[i];
|
gc = (*(g->children))[i];
|
||||||
if (x == gc->top) { // don't repeat this step if the control spans horizontally
|
if (ix == toxindex(g, gc->left)) { // don't repeat this step if the control spans horizontally
|
||||||
if (i != prev)
|
if (i != prev)
|
||||||
gc->finaly = cury;
|
gc->finaly = cury;
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue