From 95646538f7e93f485b332c2bf08f74073a952b74 Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Wed, 3 Jun 2015 17:42:08 -0400 Subject: [PATCH] Reimplemented window margins. --- redo/windows/window.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/redo/windows/window.c b/redo/windows/window.c index d9b0f77c..85e28602 100644 --- a/redo/windows/window.c +++ b/redo/windows/window.c @@ -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); }