comctl32: Draw focus rect on themed pushbuttons.

This commit is contained in:
Mark Harmstone 2015-02-15 14:23:35 +00:00 committed by Alexandre Julliard
parent dba0fe3614
commit 18c41f7128
1 changed files with 15 additions and 0 deletions

View File

@ -122,6 +122,21 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN
HeapFree(GetProcessHeap(), 0, text); HeapFree(GetProcessHeap(), 0, text);
} }
if (focused)
{
MARGINS margins;
RECT focusRect = bgRect;
GetThemeMargins(theme, hDC, BP_PUSHBUTTON, state, TMT_CONTENTMARGINS, NULL, &margins);
focusRect.left += margins.cxLeftWidth;
focusRect.top += margins.cyTopHeight;
focusRect.right -= margins.cxRightWidth;
focusRect.bottom -= margins.cyBottomHeight;
DrawFocusRect( hDC, &focusRect );
}
if (hPrevFont) SelectObject(hDC, hPrevFont); if (hPrevFont) SelectObject(hDC, hPrevFont);
} }