From 4df04a88c5dc09ccc566be6b3b3b0668832d37ad Mon Sep 17 00:00:00 2001 From: Artur Wieczorek Date: Sun, 12 Nov 2017 22:05:59 +0100 Subject: [PATCH] Set wxPG cell background colour as wxPGComboBox background colour Default wxGenericComboCtrl background colour is obtained under wxGTK with wxComboBox::GetClassDefaultAttributes(). For wxGTK 3 returned colour is fully transparent (00000000) which can cause problems with proper drawing of controls deriving from wxGenericComboCtrl, like wxPGComboBox which in turn is used by wxEnumProperty, wxCursorProperty, etc. wxPGComboBox should have background with the same colour as the cell so we can explicitly set background colour to avoid using default one. Closes #17986. --- src/propgrid/editors.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/propgrid/editors.cpp b/src/propgrid/editors.cpp index 28388e758c..4d79629af7 100644 --- a/src/propgrid/editors.cpp +++ b/src/propgrid/editors.cpp @@ -1072,6 +1072,8 @@ wxWindow* wxPGChoiceEditor::CreateControlsBase( wxPropertyGrid* propGrid, #endif // !__WXOSX__ cb->SetMargins(wxPG_XBEFORETEXT-1); + cb->SetBackgroundColour(propGrid->GetCellBackgroundColour()); + // Set hint text cb->SetHint(property->GetHintText());