Fix resizing wxPropertyGrid columns when virtual width is enabled

Columns should be resized the same way whether virtual width is enabled or disabled.
This commit is contained in:
Artur Wieczorek
2019-06-14 21:42:10 +02:00
parent f99153dbd1
commit c5cf25e9df

View File

@@ -897,35 +897,20 @@ void wxPropertyGridPageState::DoSetSplitterPosition( int newXPos,
int splitterColumn,
int flags )
{
wxPropertyGrid* pg = GetGrid();
int adjust = newXPos - DoGetSplitterPosition(splitterColumn);
if ( !pg->HasVirtualWidth() )
{
// No virtual width
int otherColumn;
if ( adjust > 0 )
{
otherColumn = splitterColumn + 1;
int otherColumn = splitterColumn + 1;
if ( otherColumn == (int)m_colWidths.size() )
otherColumn = 0;
if ( adjust > 0 )
{
m_colWidths[splitterColumn] += adjust;
PropagateColSizeDec( otherColumn, adjust, 1 );
}
else if ( adjust < 0 )
{
otherColumn = splitterColumn + 1;
if ( otherColumn == (int)m_colWidths.size() )
otherColumn = 0;
m_colWidths[otherColumn] -= adjust;
PropagateColSizeDec( splitterColumn, -adjust, -1 );
}
}
else
{
m_colWidths[splitterColumn] += adjust;
}
// Actual adjustment can be different from demanded.
newXPos = DoGetSplitterPosition(splitterColumn);