From 1700f62fd43f52640db3be3cb171dd341bf6f39b Mon Sep 17 00:00:00 2001 From: Paul Cornett Date: Tue, 28 Dec 2021 23:20:05 -0800 Subject: [PATCH] Don't take focus into account when setting selected state for cell text The selected state is always set for the background of a selected cell, so it should also be set for the text/foreground. Fixes text color for unfocused selected cells with Windows high-contrast themes. --- src/generic/datavgen.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/generic/datavgen.cpp b/src/generic/datavgen.cpp index 5d44626d47..0fc385160d 100644 --- a/src/generic/datavgen.cpp +++ b/src/generic/datavgen.cpp @@ -2832,7 +2832,7 @@ void wxDataViewMainWindow::OnPaint( wxPaintEvent &WXUNUSED(event) ) bool selected = m_selection.IsSelected(item); int state = 0; - if (m_hasFocus && selected) + if (selected) state |= wxDATAVIEW_CELL_SELECTED; cell->SetState(state);