From 696f582d3eb4da55822e6eb9115415b7b133f85b Mon Sep 17 00:00:00 2001 From: Daniel Kulp Date: Wed, 25 Aug 2021 23:21:52 +0200 Subject: [PATCH] Improve appearance of wxTreeCtrl with wxTR_ROW_LINES in dark mode Make the lines colour less bright to avoid having too high contrast between the lines and the background, notably in dark mode under macOS. See #19116. --- src/generic/treectlg.cpp | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/generic/treectlg.cpp b/src/generic/treectlg.cpp index 7827873070..fb95ecd82a 100644 --- a/src/generic/treectlg.cpp +++ b/src/generic/treectlg.cpp @@ -2816,10 +2816,7 @@ wxGenericTreeCtrl::PaintLevel(wxGenericTreeItem *item, if (HasFlag(wxTR_ROW_LINES)) { - // if the background colour is white, choose a - // contrasting color for the lines - dc.SetPen(*((GetBackgroundColour() == *wxWHITE) - ? wxMEDIUM_GREY_PEN : wxWHITE_PEN)); + dc.SetPen(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT)); dc.DrawLine(0, y_top, 10000, y_top); dc.DrawLine(0, y, 10000, y); }