From 73ac4e4160eed3a564a9cc4128b16c49e94c06a7 Mon Sep 17 00:00:00 2001 From: Jonas Kümmerlin Date: Sat, 5 Jan 2019 23:24:33 +0100 Subject: changed my mind about how fonts should be applied to new widgets --- alf/alflayout.cpp | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) (limited to 'alf/alflayout.cpp') diff --git a/alf/alflayout.cpp b/alf/alflayout.cpp index 8d03a6b..7251ca6 100644 --- a/alf/alflayout.cpp +++ b/alf/alflayout.cpp @@ -18,7 +18,7 @@ ALF_Layout_Clear(ALFLayout *layout) static void -ALF_UpdateFontForWidget(ALFWidgetPriv *widget, const ALFWindowFonts *fonts) +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); @@ -30,12 +30,12 @@ ALF_UpdateFontForWidget(ALFWidgetPriv *widget, const ALFWindowFonts *fonts) } void -ALF_Layout_UpdateFonts(ALFLayout *layout, HWND window, const ALFWindowFonts *fonts) +ALF_Layout_ApplyFonts(ALFLayout *layout, HWND window, const ALFWindowFonts *fonts) { (void)window; ALF_FOR_LIST(ALFWidgetPriv, list, &layout->widgets, i) { - ALF_UpdateFontForWidget(i, fonts); + ALF_ApplyFontForWidget(i, fonts); } } @@ -255,13 +255,6 @@ ALF_Layout_AddWidget(ALFLayout* layout, HWND window, const ALFWidgetLayoutParams SetParent(w->hwnd, window); ALF_ListInsert(layout->widgets.prev, &w->list); - - if (w->flags & ALF_MESSAGEFONT) { - ALFWindowFonts fonts; - ZeroMemory(&fonts, sizeof(fonts)); - ALF_WindowFonts(window, &fonts); - ALF_UpdateFontForWidget(w, &fonts); - } } BOOL -- cgit v1.2.3