X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/32cd189dfcfe96c41e32c3b9827bf67484c60b13..68f146206ff65cfafdf88c154aece854a0ba4864:/src/msw/button.cpp diff --git a/src/msw/button.cpp b/src/msw/button.cpp index 05c20f9b88..13f270d4c5 100644 --- a/src/msw/button.cpp +++ b/src/msw/button.cpp @@ -849,11 +849,10 @@ bool wxButton::MSWOnDraw(WXDRAWITEMSTRUCT *wxdis) } COLORREF colFg = wxColourToRGB(GetForegroundColour()); - DrawButtonText(hdc, &rectBtn, - state & ODS_NOACCEL ? GetLabelText() - : GetLabel(), - state & ODS_DISABLED ? GetSysColor(COLOR_GRAYTEXT) - : colFg); + if ( state & ODS_DISABLED ) colFg = GetSysColor(COLOR_GRAYTEXT) ; + wxString label = GetLabel(); + if ( state & ODS_NOACCEL ) label = GetLabelText() ; + DrawButtonText(hdc, &rectBtn, label, colFg); return true; }