diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index c2daf84c7d..4dca1adf94 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -1156,31 +1156,16 @@ void DrawXPBackground(wxAnyButton *button, HDC hdc, RECT& rectBtn, UINT state) ::GetThemeMargins(theme, hdc, BP_PUSHBUTTON, iState, TMT_CONTENTMARGINS, &rectBtn, &margins); ::InflateRect(&rectBtn, -margins.cxLeftWidth, -margins.cyTopHeight); - ::InflateRect(&rectBtn, -XP_BUTTON_EXTRA_MARGIN, -XP_BUTTON_EXTRA_MARGIN); if ( button->UseBgCol() && iState != PBS_HOT ) { COLORREF colBg = wxColourToRGB(button->GetBackgroundColour()); AutoHBRUSH hbrushBackground(colBg); - // don't overwrite the focus rect - RECT rectClient; - ::CopyRect(&rectClient, &rectBtn); - ::InflateRect(&rectClient, -1, -1); - - if ( wxGetWinVersion() >= wxWinVersion_10 ) - { - // buttons have flat appearance so we can fully color them - // even outside the "safe" rectangle - SelectInHDC brush(hdc, hbrushBackground); - COLORREF colTheme = GetPixel(hdc, rectClient.left, rectClient.top); - ExtFloodFill(hdc, rectClient.left, rectClient.top, colTheme, FLOODFILLSURFACE); - } - else - { - FillRect(hdc, &rectClient, hbrushBackground); - } + FillRect(hdc, &rectBtn, hbrushBackground); } + + ::InflateRect(&rectBtn, -XP_BUTTON_EXTRA_MARGIN, -XP_BUTTON_EXTRA_MARGIN); } #endif // wxUSE_UXTHEME