comctl32/listview: Update item height when changing font.

This commit is contained in:
Daniel Jelinski 2013-01-05 21:18:12 +01:00 committed by Alexandre Julliard
parent 7b1fd9e527
commit 9b8e3ca410
1 changed files with 5 additions and 0 deletions

View File

@ -10750,6 +10750,7 @@ static LRESULT LISTVIEW_SetFocus(LISTVIEW_INFO *infoPtr, HWND hwndLoseFocus)
static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedraw)
{
HFONT oldFont = infoPtr->hFont;
INT oldHeight = infoPtr->nItemHeight;
TRACE("(hfont=%p,redraw=%hu)\n", hFont, fRedraw);
@ -10758,12 +10759,16 @@ static LRESULT LISTVIEW_SetFont(LISTVIEW_INFO *infoPtr, HFONT hFont, WORD fRedra
LISTVIEW_SaveTextMetrics(infoPtr);
infoPtr->nItemHeight = LISTVIEW_CalculateItemHeight(infoPtr);
if (infoPtr->uView == LV_VIEW_DETAILS)
{
SendMessageW(infoPtr->hwndHeader, WM_SETFONT, (WPARAM)hFont, MAKELPARAM(fRedraw, 0));
LISTVIEW_UpdateSize(infoPtr);
LISTVIEW_UpdateScroll(infoPtr);
}
else if (infoPtr->nItemHeight != oldHeight)
LISTVIEW_UpdateScroll(infoPtr);
if (fRedraw) LISTVIEW_InvalidateList(infoPtr);