From 7b85f232f9a8f73c5f2a8d084b2daea0f330a1cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sat, 3 Dec 2016 11:13:24 +0100 Subject: [PATCH] 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. --- src/msw/anybutton.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/msw/anybutton.cpp b/src/msw/anybutton.cpp index 3535c6c251..503acb11b8 100644 --- a/src/msw/anybutton.cpp +++ b/src/msw/anybutton.cpp @@ -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);