From ad8d73cb15e39c4787a0ea71cb1759dc9921909f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sat, 2 Dec 2017 23:11:10 +0100 Subject: [PATCH] Work around missing expanders in wxTreeListCtrl under Mac Re-indent the column containing the expanders explicitly if the control has just switched from "list" to "tree" mode. Closes #17409. --- src/generic/treelist.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/generic/treelist.cpp b/src/generic/treelist.cpp index 1880bee6a3..6dd3f275cb 100644 --- a/src/generic/treelist.cpp +++ b/src/generic/treelist.cpp @@ -482,6 +482,13 @@ wxTreeListModel::InsertItem(Node* parent, { // Not flat any more, this is a second level child. m_isFlat = false; + + // This is a hack needed to work around wxOSX wxDataViewCtrl + // implementation which removes the indent if it thinks that the model + // is flat. We need to re-add the indent back if it turns out that it + // isn't flat, in fact. + wxDataViewCtrl* const dvc = m_treelist->GetDataView(); + dvc->SetIndent(dvc->GetIndent()); } wxScopedPtr