diff options
| author | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-20 17:18:20 +0200 |
|---|---|---|
| committer | Jonas Kümmerlin <jonas@kuemmerlin.eu> | 2020-04-20 17:18:20 +0200 |
| commit | 079fdbf1a553e314cbba386b85ca92b67c61b8df (patch) | |
| tree | 7b025b94cd6cdcb26e5dde27207f7761ac1a394d /alf/alfwindow.cpp | |
| parent | 4efad16e663d33f4700ab77c133ad99e2cdea40f (diff) | |
fixup transparent background work and add test in widgetfactory
Win32s bites once again with its 16bit WPARAM
Diffstat (limited to 'alf/alfwindow.cpp')
| -rw-r--r-- | alf/alfwindow.cpp | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/alf/alfwindow.cpp b/alf/alfwindow.cpp index 41d13e8..c11fede 100644 --- a/alf/alfwindow.cpp +++ b/alf/alfwindow.cpp @@ -197,11 +197,12 @@ ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) } if (msg == ALF_WM_SETBGCOLOR) { - priv->bgcolor = (ALFColor)wparam; + priv->bgcolor = (ALFColor)lparam; InvalidateRect(hwnd, NULL, TRUE); // fallthrough to layout, will propagate color to children + // and invalidate the background of transparent children } if (msg == ALF_WM_GETBGCOLOR) { @@ -374,6 +375,17 @@ ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) if (msg == WM_THEMECHANGED || msg == WM_SETTINGCHANGE) { ALF_UpdateFontsPriv(hwnd, priv); ALF_Layout_Invalidate(&priv->layout, hwnd); + ALF_InvalidateBackground(hwnd); + InvalidateRect(hwnd, NULL, TRUE); + } + + if (msg == ALF_WM_BACKGROUNDCHANGE) { + if (priv->bgcolor != ALF_COLOR_TRANSPARENT) + return 0; // nothing to do here, background is our own solid color + + InvalidateRect(hwnd, NULL, TRUE); + + // fallthrough to layout, will propagate to transparent children } if (msg == DM_GETDEFID) { @@ -399,6 +411,12 @@ ALF_DefWindowProc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam) return TRUE; } + if (msg == WM_WINDOWPOSCHANGED) { + if (priv->vtbl->windowposchanged) { + priv->vtbl->windowposchanged(priv->closure, hwnd, (WINDOWPOS *)lparam); + } + } + LRESULT ret = 0; if (ALF_Layout_HandleMessage(&priv->layout, hwnd, msg, wparam, lparam, &ret)) { // if the layout was changed, our current size might be too small |
