From 15855306237d0ad1627caa3d4cb69129c80b6fae Mon Sep 17 00:00:00 2001 From: Maarten Bent Date: Wed, 16 Dec 2015 21:04:15 +0100 Subject: [PATCH] Show custom foreground colour when theme is used. --- src/msw/renderer.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/msw/renderer.cpp b/src/msw/renderer.cpp index 429d7c884d..36b754b75f 100644 --- a/src/msw/renderer.cpp +++ b/src/msw/renderer.cpp @@ -1036,10 +1036,20 @@ void wxRendererXP::DrawItemText(wxWindow* win, textOpts.dwSize = sizeof(textOpts); textOpts.dwFlags = DTT_STATEID; textOpts.iStateId = itemState; - if (flags & wxCONTROL_DISABLED) + + wxColour textColour = dc.GetTextForeground(); + if (flags & wxCONTROL_SELECTED) { + textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_LISTBOXTEXT); + } + else if (flags & wxCONTROL_DISABLED) + { + textColour = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT); + } + + if (textColour.IsOk()) { textOpts.dwFlags |= DTT_TEXTCOLOR; - textOpts.crText = wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT).GetPixel(); + textOpts.crText = textColour.GetPixel(); } DWORD textFlags = DT_NOPREFIX;