Autosize the right columns in macOS wxDataViewCtrl
This is related to 7555d1b245
(Fix expansion of the last column in macOS
wxDataViewCtrl, 2021-01-26) which somehow didn't apply the patch fully,
so finish applying it now.
Closes #14939.
This commit is contained in:
committed by
Vadim Zeitlin
parent
60c620c28c
commit
36ea7ff4d6
@@ -2340,7 +2340,7 @@ void wxCocoaDataViewControl::FitColumnWidthToContent(unsigned int pos)
|
|||||||
|
|
||||||
if ( pos == noOfColumns - 1 )
|
if ( pos == noOfColumns - 1 )
|
||||||
[m_OutlineView sizeLastColumnToFit];
|
[m_OutlineView sizeLastColumnToFit];
|
||||||
else
|
else if ( GetColumn(pos)->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE )
|
||||||
[column setWidth:calculator.GetMaxWidth() + m_expanderWidth];
|
[column setWidth:calculator.GetMaxWidth() + m_expanderWidth];
|
||||||
|
|
||||||
if ( !(GetDataViewCtrl()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) )
|
if ( !(GetDataViewCtrl()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) )
|
||||||
|
@@ -302,10 +302,7 @@ void wxOSXDataViewModelNotifier::AdjustAutosizedColumns()
|
|||||||
unsigned count = m_DataViewCtrlPtr->GetColumnCount();
|
unsigned count = m_DataViewCtrlPtr->GetColumnCount();
|
||||||
for ( unsigned col = 0; col < count; col++ )
|
for ( unsigned col = 0; col < count; col++ )
|
||||||
{
|
{
|
||||||
wxDataViewColumn *column = m_DataViewCtrlPtr->GetColumnPtr(col);
|
m_DataViewCtrlPtr->GetDataViewPeer()->FitColumnWidthToContent(col);
|
||||||
|
|
||||||
if ( column->GetWidthVariable() == wxCOL_WIDTH_AUTOSIZE )
|
|
||||||
m_DataViewCtrlPtr->GetDataViewPeer()->FitColumnWidthToContent(col);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user