From 6e885992f52f73b7b0c636167c5e9717f0d9b293 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Fri, 16 Dec 2016 19:09:47 +0100 Subject: [PATCH] Fix rendering of inert wxDVC cells in wxOSX Disabled appearance should only be used for disabled rows of otherwise activable or editable renderers, not for inert ones. A typical example is a bitmap renderer which rendered bitmaps slightly lighter due to its disabled appearance. With this fix, the behavior is now consistent across the three implementations. --- src/osx/cocoa/dataview.mm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index f43d031ef8..906c7f5922 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2874,6 +2874,12 @@ void wxDataViewRenderer::SetAttr(const wxDataViewItemAttr& attr) void wxDataViewRenderer::SetEnabled(bool enabled) { + // setting the appearance to disabled grey should only be done for + // the active cells which are disabled, not for the cells which can + // never be edited at all + if ( GetMode() == wxDATAVIEW_CELL_INERT ) + enabled = true; + [GetNativeData()->GetItemCell() setEnabled:enabled]; }