From 9a3bffe5663f9220d04e9a6463aec0dc0bae3b9b Mon Sep 17 00:00:00 2001 From: Pietro Gagliardi Date: Tue, 1 Sep 2015 11:46:53 -0400 Subject: [PATCH] Fixed a whole bunch of sizing issues on the Windows backend. --- redo/windows/box.c | 3 +++ redo/windows/tab.c | 3 +-- redo/windows/tabpage.c | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/redo/windows/box.c b/redo/windows/box.c index cc0a9893..6c8e8f89 100644 --- a/redo/windows/box.c +++ b/redo/windows/box.c @@ -186,6 +186,9 @@ static void boxRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi } // 3) now we can position controls + // first, make relative to the top-left corner of the container + x = 0; + y = 0; for (i = 0; i < b->controls->len; i++) { bc = ptrArrayIndex(b->controls, struct child *, i); //TODO if (!uiControlContainerVisible(bc->c)) diff --git a/redo/windows/tab.c b/redo/windows/tab.c index 7b82273d..565740a5 100644 --- a/redo/windows/tab.c +++ b/redo/windows/tab.c @@ -117,7 +117,6 @@ static void tabRelayout(uiWindowsControl *c, intmax_t x, intmax_t y, intmax_t wi // now we need to figure out what rect the child goes // this rect needs to be in parent window coordinates, but TCM_ADJUSTRECT wants a window rect, which is screen coordinates -printf("%d %d %d %d -> ", (int)x, (int)y, (int)width, (int)height); r.left = x; r.top = y; r.right = x + width; @@ -126,7 +125,7 @@ printf("%d %d %d %d -> ", (int)x, (int)y, (int)width, (int)height); mapWindowRect(t->hwnd, NULL, &r); SendMessageW(t->hwnd, TCM_ADJUSTRECT, (WPARAM) FALSE, (LPARAM) (&r)); mapWindowRect(NULL, t->hwnd, &r); -printf("%d %d %d %d\n", (int)r.left, (int)r.top, (int)r.right-r.left, (int)r.bottom-r.top); + childRelayout(page, r.left, r.top, r.right - r.left, r.bottom - r.top); } diff --git a/redo/windows/tabpage.c b/redo/windows/tabpage.c index ea30d4d0..361cb301 100644 --- a/redo/windows/tabpage.c +++ b/redo/windows/tabpage.c @@ -58,5 +58,8 @@ HWND newTabPage(void) if (hr != S_OK) logHRESULT("error setting tab page background in newTabPage()", hr); + // and start the tab page hidden + ShowWindow(hwnd, SW_HIDE); + return hwnd; }