Quick bugfix in childMinimumSizeChanged for uiWindow.

This commit is contained in:
Pietro Gagliardi 2016-04-27 01:25:36 -04:00
parent 40672cc5c4
commit 4866168ecf
1 changed files with 4 additions and 6 deletions

View File

@ -237,15 +237,13 @@ static void uiWindowChildMinimumSizeChanged(uiWindowsControl *c)
int mx, my; int mx, my;
uiWindowsControlMinimumSize(uiWindowsControl(w->child), &width, &height); uiWindowsControlMinimumSize(uiWindowsControl(w->child), &width, &height);
windowMargns(w, &mx, &my);
width += 2 * mx;
height += 2 * my;
getClientRect(w->hwnd, &r); getClientRect(w->hwnd, &r);
// TODO discount margins windowMargins(w, &mx, &my);
needsGrowing = FALSE; needsGrowing = FALSE;
if ((r.right - r.left) < width) // subtract margins so we only care about the area that's used
if ((r.right - r.left - (2 * mx)) < width)
needsGrowing = TRUE; needsGrowing = TRUE;
if ((r.bottom - r.top) < height) if ((r.bottom - r.top - (2 * my)) < height)
needsGrowing = TRUE; needsGrowing = TRUE;
if (!needsGrowing) if (!needsGrowing)
return; return;