Merge branch 'donovan6000_wxdataviewitem_fix' of https://github.com/donovan6000/wxWidgets

Render disabled items as greyed out in wxDataViewCtrl.

See https://github.com/wxWidgets/wxWidgets/pull/1277
This commit is contained in:
Vadim Zeitlin
2019-03-26 15:05:59 +01:00
2 changed files with 2 additions and 2 deletions

View File

@@ -1067,7 +1067,7 @@ wxDataViewCustomRendererBase::RenderText(const wxString& text,
int flags = 0;
if ( state & wxDATAVIEW_CELL_SELECTED )
flags |= wxCONTROL_SELECTED;
if ( !GetOwner()->GetOwner()->IsEnabled() )
if ( !(GetOwner()->GetOwner()->IsEnabled() && GetEnabled()) )
flags |= wxCONTROL_DISABLED;
// Notice that we intentionally don't use any alignment here: it is not

View File

@@ -1298,7 +1298,7 @@ bool wxDataViewToggleRenderer::Render( wxRect cell, wxDC *dc, int WXUNUSED(state
if (m_toggle)
flags |= wxCONTROL_CHECKED;
if (GetMode() != wxDATAVIEW_CELL_ACTIVATABLE ||
GetEnabled() == false)
!(GetOwner()->GetOwner()->IsEnabled() && GetEnabled()))
flags |= wxCONTROL_DISABLED;
// Ensure that the check boxes always have at least the minimal required