diff --git a/TODO.md b/TODO.md index 4c90dc81..3862f534 100644 --- a/TODO.md +++ b/TODO.md @@ -62,6 +62,11 @@ - whenever a list of things is destroyed, each successive item must be removed as it is destroyed, otherwise we might wind up in a situation where we access items after they're freed - make the name of the variable to refer to a single tab page consistent (already decided to make them all `page`) - make sure uiEntryOnChanged() is not triggered when calling uiEntrySetText() +- clean up windows resizing logic + - make it so that only top-level window resizes trigger an update; container resizes do not update + - windows resizing logic is simply not comprehensive enough (no null resizes allowed) to do things + - we control resizes of all children so we can reliably update after a resize + - we already need to do this in uiContainer :/ ultimately: - add some sort of runtime type checking diff --git a/box.c b/box.c index ebc60c3b..0031a206 100644 --- a/box.c +++ b/box.c @@ -2,9 +2,6 @@ #include "ui.h" #include "uipriv.h" -// TODO -// - horizontal boxes (only) inside vertical boxes (and vice versa) aren't updated on Windows (only) when padded changes until a horizontal (only; vertical) resize - struct box { uiBox b; void (*baseDestroy)(uiControl *); diff --git a/windows/container.c b/windows/container.c index 54919490..ae158886 100644 --- a/windows/container.c +++ b/windows/container.c @@ -318,6 +318,9 @@ static void containerResize(uiControl *cc, intmax_t x, intmax_t y, intmax_t widt if (MoveWindow(c->hwnd, x, y, width, height, TRUE) == 0) logLastError("error resizing uiContainer in containerResize()"); + // under some circumstances this might not be sufficient + // example: check the Spaced checkbox; inside boxes will have been resized already before they get a chance to update their padded + SendMessageW(c->hwnd, msgUpdateChild, 0, 0); } static int containerVisible(uiControl *cc)