From ede551151741a0c572c2f42946935623e94ce7b7 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Thu, 14 Dec 2006 13:54:06 +0000 Subject: [PATCH] fixed wxStdRenderer::DrawButtonLabel() to not change text colour, otherwise menu items below a disabled item would be rendered incorrectly git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@43975 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/univ/stdrend.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/univ/stdrend.cpp b/src/univ/stdrend.cpp index 6d7040a705..ea50847d70 100644 --- a/src/univ/stdrend.cpp +++ b/src/univ/stdrend.cpp @@ -257,6 +257,8 @@ void wxStdRenderer::DrawButtonLabel(wxDC& dc, int indexAccel, wxRect *rectBounds) { + wxDCTextColourChanger clrChanger(dc); + wxRect rectLabel = rect; if ( !label.empty() && (flags & wxCONTROL_DISABLED) ) { @@ -267,13 +269,13 @@ void wxStdRenderer::DrawButtonLabel(wxDC& dc, } // draw shadow of the text - dc.SetTextForeground(m_penHighlight.GetColour()); + clrChanger.Set(m_penHighlight.GetColour()); wxRect rectShadow = rect; rectShadow.Offset(1, 1); dc.DrawLabel(label, rectShadow, alignment, indexAccel); // make the main label text grey - dc.SetTextForeground(m_penDarkGrey.GetColour()); + clrChanger.Set(m_penDarkGrey.GetColour()); if ( flags & wxCONTROL_FOCUSED ) { -- 2.45.2