From b7e0625b9046013a4c4c495d76b1d5ee0a802bb9 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Tue, 22 Mar 2016 21:44:38 +0100 Subject: [PATCH] Don't indent the expander column in list wxDataViewCtrl in wxOSX Indenting the column contents to leave enough space for the expanders is unnecessary in this case, so just don't do it. Closes #17409. --- docs/changes.txt | 1 + src/osx/cocoa/dataview.mm | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/docs/changes.txt b/docs/changes.txt index 80c746a309..55618bd2cf 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -85,6 +85,7 @@ wxOSX: - Set up extensions filter correctly in wxFileDialog (nick863). - Turn off automatic quotes substitutions in wxTextCtrl (Xlord2). - Implement wxDataViewChoiceByIndexRenderer (wanup). +- Fix unnecessary indentation in list-like wxDataViewCtrl (Andreas Falkenhahn). Unix: diff --git a/src/osx/cocoa/dataview.mm b/src/osx/cocoa/dataview.mm index 61f493874a..3bd3efadb7 100644 --- a/src/osx/cocoa/dataview.mm +++ b/src/osx/cocoa/dataview.mm @@ -2239,6 +2239,15 @@ bool wxCocoaDataViewControl::AssociateModel(wxDataViewModel* model) else m_DataSource = NULL; [m_OutlineView setDataSource:m_DataSource]; // if there is a data source the data is immediately going to be requested + + // By default, the first column is indented to leave enough place for the + // expanders, but this looks bad if there are no expanders, so don't use + // indent in this case. + if ( model && model->IsListModel() ) + { + DoSetIndent(0); + } + return true; }