X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/52c5093f76e534ec1a39f9f88a9b510b7cf3dbf2..3316192f0d8a79103271a48cf293a338ba817975:/src/msw/control.cpp diff --git a/src/msw/control.cpp b/src/msw/control.cpp index cab5151e1c..e71efd8f1e 100644 --- a/src/msw/control.cpp +++ b/src/msw/control.cpp @@ -375,10 +375,6 @@ bool wxControl::MSWOnNotify(int idCtrl, WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) { HDC hdc = (HDC)pDC; - if ( m_hasFgCol ) - { - ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour())); - } WXHBRUSH hbr = 0; if ( !colBg.Ok() ) @@ -402,12 +398,14 @@ WXHBRUSH wxControl::DoMSWControlColor(WXHDC pDC, wxColour colBg, WXHWND hWnd) hbr = (WXHBRUSH)brush->GetResourceHandle(); } - // if we use custom background, we should set foreground ourselves too - if ( hbr && !m_hasFgCol ) + // always set the foreground colour if we changed the background, whether + // m_hasFgCol is true or not: if it true, we must do it, of course, but + // even if it isn't, we must set the default foreground explicitly as by + // default just the simple black is used + if ( hbr ) { - ::SetTextColor(hdc, ::GetSysColor(COLOR_WINDOWTEXT)); + ::SetTextColor(hdc, wxColourToRGB(GetForegroundColour())); } - //else: already set above return hbr; }