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.
This commit is contained in:
Vadim Zeitlin
2017-12-02 23:11:10 +01:00
parent 3380a2438d
commit ad8d73cb15

View File

@@ -482,6 +482,13 @@ wxTreeListModel::InsertItem(Node* parent,
{ {
// Not flat any more, this is a second level child. // Not flat any more, this is a second level child.
m_isFlat = false; 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<Node> wxScopedPtr<Node>