Skip to content

Commit 75c0dc0

Browse files
authored
[EXPLORER][COMCTL32][SHELL32] Enable SPI_SETICONTITLELOGFONT (reactos#7783)
Enable desktop icon title font setting. JIRA issue: CORE-13601 - Forward WM_SETTINGCHANGE message up to ListView. - ListView accepts WM_SETTINGCHANGE message. - Enable icon spacing.
1 parent 8e53386 commit 75c0dc0

File tree

3 files changed

+33
-0
lines changed

3 files changed

+33
-0
lines changed

base/shell/explorer/traywnd.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2454,6 +2454,9 @@ class CTrayWindow :
24542454
CheckTrayWndPosition();
24552455
}
24562456

2457+
if (m_DesktopWnd)
2458+
::SendMessageW(m_DesktopWnd, uMsg, wParam, lParam);
2459+
24572460
if (m_StartMenuPopup && lstrcmpiW((LPCWSTR)lParam, L"TraySettings") == 0)
24582461
{
24592462
HideStartMenu();

dll/win32/comctl32/listview.c

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12001,7 +12001,36 @@ LISTVIEW_WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
1200112001
}
1200212002
return DefWindowProcW(hwnd, uMsg, wParam, lParam);
1200312003

12004+
#ifdef __REACTOS__
12005+
case WM_SETTINGCHANGE: /* Same as WM_WININICHANGE */
12006+
if (wParam == SPI_SETICONMETRICS ||
12007+
wParam == SPI_SETICONTITLELOGFONT ||
12008+
wParam == SPI_SETNONCLIENTMETRICS ||
12009+
(!wParam && !lParam))
12010+
{
12011+
BOOL bDefaultOrNullFont = (infoPtr->hDefaultFont == infoPtr->hFont || !infoPtr->hFont);
12012+
LOGFONTW logFont;
12013+
SystemParametersInfoW(SPI_GETICONTITLELOGFONT, 0, &logFont, 0);
12014+
12015+
if (infoPtr->autoSpacing)
12016+
LISTVIEW_SetIconSpacing(infoPtr, -1, -1);
12017+
12018+
if (infoPtr->hDefaultFont)
12019+
DeleteObject(infoPtr->hDefaultFont);
12020+
infoPtr->hDefaultFont = CreateFontIndirectW(&logFont);
12021+
12022+
if (bDefaultOrNullFont)
12023+
infoPtr->hFont = infoPtr->hDefaultFont;
12024+
12025+
LISTVIEW_SaveTextMetrics(infoPtr);
12026+
LISTVIEW_UpdateItemSize(infoPtr);
12027+
LISTVIEW_UpdateScroll(infoPtr);
12028+
LISTVIEW_InvalidateRect(infoPtr, NULL);
12029+
}
12030+
return 0;
12031+
#else
1200412032
/* case WM_WININICHANGE: */
12033+
#endif
1200512034

1200612035
default:
1200712036
if ((uMsg >= WM_USER) && (uMsg < WM_APP) && !COMCTL32_IsReflectedMessage(uMsg))

dll/win32/shell32/CDefView.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3008,6 +3008,7 @@ LRESULT CDefView::OnSettingChange(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL
30083008
if (wParam == SPI_SETDESKWALLPAPER || wParam == 0)
30093009
UpdateListColors();
30103010

3011+
m_ListView.SendMessage(uMsg, wParam, lParam);
30113012
return S_OK;
30123013
}
30133014

0 commit comments

Comments
 (0)