From 12ba6ccef311641c991c4bf1334627b27d8e263e Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sat, 6 Jun 2020 11:54:18 +0200 Subject: forward WM_SETTINGCHANGE and WM_SYSCOLORCHANGE to controls --- alf/alflayout.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) (limited to 'alf/alflayout.cpp') diff --git a/alf/alflayout.cpp b/alf/alflayout.cpp index 745b303..ba2854b 100644 --- a/alf/alflayout.cpp +++ b/alf/alflayout.cpp @@ -1056,6 +1056,28 @@ ALF_Layout_HandleMessage(ALFLayout *layout, HWND hwnd, UINT msg, WPARAM wparam, return TRUE; } + if (msg == WM_SYSCOLORCHANGE) { + // forward to children + ALF_FOR_LIST(ALFControlPriv, list, &layout->controls, c) { + SendMessage(c->hwnd, WM_SYSCOLORCHANGE, wparam, lparam); + } + + return FALSE; + } + + if (msg == WM_SETTINGCHANGE) { + // Controls could technically figure out if their layout parameters + // have changed, but that is not easy so nobody would bother anyway. + ALF_Layout_Invalidate(layout, hwnd); + + // forward to children + ALF_FOR_LIST(ALFControlPriv, list, &layout->controls, c) { + SendMessage(c->hwnd, WM_SETTINGCHANGE, wparam, lparam); + } + + return FALSE; + } + if (msg == ALF_WM_SETBGCOLOR) { *pRet = 1; if (layout->bgcolor == (ALFColor)lparam) -- cgit v1.2.3