mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-08-26 19:33:31 +00:00
[COMCTL32] ListView must update header font if it deletes the old font (#8287)
A bug fix for PR #7783
This commit is contained in:
@@ -12013,6 +12013,7 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
wParam == SPI_SETNONCLIENTMETRICS ||
|
||||
(!wParam && !lParam))
|
||||
{
|
||||
HFONT hOldDefaultFont = infoPtr->hDefaultFont;
|
||||
BOOL bDefaultOrNullFont = (infoPtr->hDefaultFont == infoPtr->hFont || !infoPtr->hFont);
|
||||
LOGFONTW logFont;
|
||||
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
|
||||
@@ -12025,7 +12026,12 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
|
||||
infoPtr->hDefaultFont = CreateFontIndirectW(&logFont);
|
||||
|
||||
if (bDefaultOrNullFont)
|
||||
{
|
||||
infoPtr->hFont = infoPtr->hDefaultFont;
|
||||
// Check if we just deleted the font the header is using
|
||||
if (infoPtr->hwndHeader && hOldDefaultFont == GetWindowFont(infoPtr->hwndHeader))
|
||||
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)infoPtr->hFont, TRUE);
|
||||
}
|
||||
|
||||
LISTVIEW_SaveTextMetrics(infoPtr);
|
||||
LISTVIEW_UpdateItemSize(infoPtr);
|
||||
|
||||
Reference in New Issue
Block a user