From fbf2343ea06f263006dfc2539f4a1dfd321ebe63 Mon Sep 17 00:00:00 2001 From: Julian Smart Date: Thu, 24 Feb 2011 10:02:44 +0000 Subject: [PATCH] Fix for #12979: wrong unfocused selected text colour in wxTreeCtrl/wxListCtrl git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_8_BRANCH@67011 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/generic/listctrl.cpp | 9 +++++++++ src/generic/treectlg.cpp | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/generic/listctrl.cpp b/src/generic/listctrl.cpp index 0645e906ed..2023642a78 100644 --- a/src/generic/listctrl.cpp +++ b/src/generic/listctrl.cpp @@ -1426,8 +1426,17 @@ bool wxListLineData::SetAttributes(wxDC *dc, else colText = *wxBLACK; } +#else + { +#ifdef __WXGTK__ + if (m_owner->HasFocus()) + colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); + else + colText = wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTIONTEXT); #else colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); +#endif + } #endif else if ( attr && attr->HasTextColour() ) colText = attr->GetTextColour(); diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index a91c06c041..5c6fccdee2 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2549,7 +2549,16 @@ void wxGenericTreeCtrl::PaintLevel( wxGenericTreeItem *item, wxDC &dc, int level #ifdef __WXMAC__ colText = *wxWHITE; #else + +#ifdef __WXGTK__ + if (m_hasFocus) + colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); + else + colText = wxSystemSettings::GetColour(wxSYS_COLOUR_INACTIVECAPTIONTEXT); +#else colText = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); +#endif + #endif } else