Don't use custom background color in PBS_HOT state

MSW buttons are highlighted by the theme when the mouse hovers over
them. This servers as a feedback to the user that the button is
clickable, so it's desirable to preserve it even if the button uses a
custom background color.
This commit is contained in:
Václav Slavík 2016-12-03 11:13:24 +01:00 committed by Václav Slavík
parent c9b1ebf816
commit 7b85f232f9

View File

@ -1131,7 +1131,7 @@ void DrawXPBackground(wxAnyButton *button, HDC hdc, RECT& rectBtn, UINT state)
::InflateRect(&rectBtn, -margins.cxLeftWidth, -margins.cyTopHeight);
::InflateRect(&rectBtn, -XP_BUTTON_EXTRA_MARGIN, -XP_BUTTON_EXTRA_MARGIN);
if ( button->UseBgCol() )
if ( button->UseBgCol() && iState != PBS_HOT )
{
COLORREF colBg = wxColourToRGB(button->GetBackgroundColour());
AutoHBRUSH hbrushBackground(colBg);