Fix expansion of the last column in macOS wxDataViewCtrl
It should always take the rest of the available space. See #14939.
This commit is contained in:
committed by
Vadim Zeitlin
parent
17239d5c3d
commit
7555d1b245
@@ -2184,6 +2184,7 @@ void wxCocoaDataViewControl::FitColumnWidthToContent(unsigned int pos)
|
||||
{
|
||||
const int count = GetCount();
|
||||
NSTableColumn *column = GetColumn(pos)->GetNativeData()->GetNativeColumnPtr();
|
||||
UInt32 const noOfColumns = [[m_OutlineView tableColumns] count];
|
||||
|
||||
class MaxWidthCalculator
|
||||
{
|
||||
@@ -2314,7 +2315,10 @@ void wxCocoaDataViewControl::FitColumnWidthToContent(unsigned int pos)
|
||||
if ( m_expanderWidth == 0 )
|
||||
m_expanderWidth = calculator.GetExpanderWidth();
|
||||
|
||||
[column setWidth:calculator.GetMaxWidth() + m_expanderWidth];
|
||||
if ( pos == noOfColumns - 1 )
|
||||
[m_OutlineView sizeLastColumnToFit];
|
||||
else
|
||||
[column setWidth:calculator.GetMaxWidth() + m_ExpanderWidth];
|
||||
|
||||
if ( !(GetDataViewCtrl()->GetWindowStyle() & wxDV_VARIABLE_LINE_HEIGHT) )
|
||||
{
|
||||
|
Reference in New Issue
Block a user