From 41ffadc987fef77a8097fd050bfe7bf02c65b545 Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Mon, 19 Feb 2024 09:52:03 +0300 Subject: [PATCH] Use correct text color in LIB_TREE selected items on non-OSX. (cherry picked from commit 6feafedfbe93464162a685e87cff3eab034b5c3f) --- common/lib_tree_model_adapter.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/common/lib_tree_model_adapter.cpp b/common/lib_tree_model_adapter.cpp index 0326c1e84b..e10150e2ef 100644 --- a/common/lib_tree_model_adapter.cpp +++ b/common/lib_tree_model_adapter.cpp @@ -91,14 +91,19 @@ public: dc->DrawLines( 6, points ); } + aRect.Deflate( 1 ); + +#ifdef __WXOSX__ // We should be able to pass wxDATAVIEW_CELL_SELECTED into RenderText() and have it do - // the right thing -- but it picks wxSYS_COLOUR_HIGHLIGHTTEXT on MacOS and GTK (instead + // the right thing -- but it picks wxSYS_COLOUR_HIGHLIGHTTEXT on MacOS (instead // of wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT). if( aState & wxDATAVIEW_CELL_SELECTED ) dc->SetTextForeground( wxSystemSettings::GetColour( wxSYS_COLOUR_LISTBOXHIGHLIGHTTEXT ) ); - aRect.Deflate( 1 ); RenderText( m_text, 0, aRect, dc, 0 ); +#else + RenderText( m_text, 0, aRect, dc, aState ); +#endif return true; }