Closed StefanBattmer closed 3 weeks ago
Strangely, I have a different problem: for me, with the default GNOME dark theme (i.e. dark variant of Adwaita), the disabled text colour is just the same white as for the normal cells. And this is not really surprising seeing that it is set to the same colour as the normal caption colour by default here:
I can fix this by applying
diff --git a/src/propgrid/propgrid.cpp b/src/propgrid/propgrid.cpp
index 937d08e615..1ecfe88853 100644
--- a/src/propgrid/propgrid.cpp
+++ b/src/propgrid/propgrid.cpp
@@ -1499,7 +1499,7 @@ void wxPropertyGrid::RegainColours()
m_colLine = m_colCapBack;
if ( !(m_coloursCustomized & CustomColour_DisabledText) )
- m_colDisPropFore = m_colCapFore;
+ m_colDisPropFore = wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT );
m_colEmptySpace = wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
}
but I feel like I'm missing something here: how come the colour is grey even without this change in the light theme, as can be easily seen in the propgrid sample, which has a few disabled properties by default ("OS", "User Id", "User Name")?
@vadz: Many, many thanks! Fun fact: We just kind of met again: https://github.com/swig/swig/issues/2889 ;-)
Description
This most likely comes from the fact that the default text color for disabled properties is not necessarily a system color but something that comes out of the
wxPGAdjustColour
function when called from thevoid wxPropertyGrid::RegainColours()
function:The result is a very dark grey on a black background. We fixed this for our application by calling
pPropGridManager->GetGrid()->SetCellDisabledTextColour( wxSystemSettings::GetColour( wxSYS_COLOUR_GRAYTEXT ) );
after creating the grid.