Module: wine Branch: master Commit: 18c41f7128522d3f3c50baf76c3653a970ef7dd7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=18c41f7128522d3f3c50baf76c...
Author: Mark Harmstone hellas@burntcomma.com Date: Sun Feb 15 14:23:35 2015 +0000
comctl32: Draw focus rect on themed pushbuttons.
---
dlls/comctl32/theme_button.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+)
diff --git a/dlls/comctl32/theme_button.c b/dlls/comctl32/theme_button.c index 3935333..9b0a5cf 100644 --- a/dlls/comctl32/theme_button.c +++ b/dlls/comctl32/theme_button.c @@ -122,6 +122,21 @@ static void PB_draw(HTHEME theme, HWND hwnd, HDC hDC, ButtonState drawState, UIN 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); }