summaryrefslogtreecommitdiff
path: root/alf/alfpanel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'alf/alfpanel.cpp')
-rw-r--r--alf/alfpanel.cpp14
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;
}