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/alfpanel.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/alfpanel.cpp')
| -rw-r--r-- | alf/alfpanel.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/alf/alfpanel.cpp b/alf/alfpanel.cpp index eb954ec..7e109bb 100644 --- a/alf/alfpanel.cpp +++ b/alf/alfpanel.cpp @@ -73,11 +73,12 @@ ALF_Panel_DefWindowProc(HWND window, UINT msg, WPARAM wparam, LPARAM lparam) } if (msg == ALF_WM_SETBGCOLOR) { - priv->bgcolor = (ALFColor)wparam; + priv->bgcolor = (ALFColor)lparam; InvalidateRect(window, NULL, TRUE); // fallthrough to layout, will propagate color to children + // and invalidate the background of transparent children } if (msg == WM_GETFONT) { @@ -121,6 +122,15 @@ ALF_Panel_DefWindowProc(HWND window, UINT msg, WPARAM wparam, LPARAM lparam) ALF_Layout_Apply(&priv->layout, window); } + if (msg == ALF_WM_BACKGROUNDCHANGE) { + if (priv->bgcolor != ALF_COLOR_TRANSPARENT) + return 0; // nothing to do here, background is our own solid color + + InvalidateRect(window, NULL, TRUE); + + // fallthrough to layout, will propagate to transparent children + } + LRESULT ret = 0; if (ALF_Layout_HandleMessage(&priv->layout, window, msg, wparam, lparam, &ret)) return ret; @@ -200,7 +210,7 @@ ALF_AddPanel(HWND parent, WORD id, int x, int y) { HWND hwndPanel = ALF_CreatePanelWindow(parent, id); - ALF_AddWidget(parent, x, y, hwndPanel, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_INHERITBGCOLOR); + ALF_AddWidget(parent, x, y, hwndPanel, 0, 0, ALF_LAYOUT_SIZE_QUERY | ALF_LAYOUT_INHERITFONT | ALF_LAYOUT_INHERITBGCOLOR | ALF_LAYOUT_SENDBGCHANGE); return hwndPanel; } |
