Reimplemented window margins.

This commit is contained in:
Pietro Gagliardi 2015-06-03 17:42:08 -04:00
parent 27e7057672
commit 95646538f7
1 changed files with 6 additions and 3 deletions

View File

@ -192,10 +192,13 @@ static void windowResizeChild(uiWindow *ww)
return;
if (GetClientRect(w->hwnd, &r) == 0)
logLastError("error getting uiWindow client rect in windowComputeChildSize()");
if (w->margined) {
// TODO
}
d = uiControlSizing(uiControl(w));
if (w->margined) {
r.left += uiWindowsDlgUnitsToX(windowMargin, d->Sys->BaseX);
r.top += uiWindowsDlgUnitsToY(windowMargin, d->Sys->BaseY);
r.right -= uiWindowsDlgUnitsToX(windowMargin, d->Sys->BaseX);
r.bottom -= uiWindowsDlgUnitsToY(windowMargin, d->Sys->BaseY);
}
uiControlResize(w->child, r.left, r.top, r.right - r.left, r.bottom - r.top, d);
uiFreeSizing(d);
}