From e3daffea5b8596a5dfcf9a79920d9c17344f511b Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sun, 6 Jan 2019 22:40:10 +0100 Subject: initial panel implementation --- alf/alflayout.cpp | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) (limited to 'alf/alflayout.cpp') diff --git a/alf/alflayout.cpp b/alf/alflayout.cpp index 5e207d8..caf9857 100644 --- a/alf/alflayout.cpp +++ b/alf/alflayout.cpp @@ -20,12 +20,17 @@ ALF_Layout_Clear(ALFLayout *layout) static void ALF_ApplyFontForWidget(ALFWidgetPriv *widget, const ALFWindowFonts *fonts) { - if (widget->hwnd && (widget->flags & ALF_MESSAGEFONT) == ALF_MESSAGEFONT) { - SendMessage(widget->hwnd, WM_SETFONT, (WPARAM)fonts->hMessageFont, (LPARAM)NULL); + if (widget->hwnd) { + if (widget->flags & ALF_MESSAGEFONT) { + SendMessage(widget->hwnd, WM_SETFONT, (WPARAM)fonts->hMessageFont, (LPARAM)NULL); - // XXX: Invalidating should IMHO be the decision of the control, but at - // least the commctl32 V5 static control doesn't do it. - InvalidateRect(widget->hwnd, NULL, TRUE); + // XXX: Invalidating should IMHO be the decision of the control, but at + // least the commctl32 V5 static control doesn't do it. + InvalidateRect(widget->hwnd, NULL, TRUE); + } + if ((widget->flags & ALF_ALLFONTS) == ALF_ALLFONTS) { + SendMessage(widget->hwnd, ALF_WM_APPLYFONTS, 0, (LPARAM)fonts); + } } } @@ -329,6 +334,11 @@ ALF_Layout_HandleMessage(ALFLayout *layout, HWND hwnd, UINT msg, WPARAM wparam, return TRUE; } + if (msg == ALF_WM_APPLYFONTS && lparam != 0) { + ALF_Layout_ApplyFonts(layout, hwnd, (const ALFWindowFonts *)lparam); + return TRUE; + } + if (msg == ALF_WM_APPLYLAYOUT) { ALF_Layout_Apply(layout, hwnd); return TRUE; -- cgit v1.2.3