Set tab label colour in AUI native MSW tab art

We must always change the text colour when using non-default background
colour, as otherwise the text may become unreadable in some themes,
which was exactly what happened in the standard "High contrast" theme
when using wxAUI under MSW before.

Closes https://github.com/wxWidgets/wxWidgets/pull/1989

Closes #18832.
This commit is contained in:
mimi89999 2020-07-19 22:56:39 +02:00 committed by Vadim Zeitlin
parent 1a4eff90ae
commit 70659b6b7c

View File

@ -17,6 +17,7 @@
#ifndef WX_PRECOMP
#include "wx/dc.h"
#include "wx/settings.h"
#endif
#include "wx/aui/tabart.h"
@ -213,6 +214,7 @@ void wxAuiMSWTabArt::DrawTab(wxDC& dc,
textRect.width -= m_closeBtnSize.x + wnd->FromDIP(3);
dc.SetFont(wnd->GetFont());
dc.SetTextForeground(wxSystemSettings::GetColour(wxSYS_COLOUR_BTNTEXT));
dc.DrawLabel(page.caption, page.bitmap, textRect, wxALIGN_CENTRE);
// draw focus rectangle