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:
@@ -897,34 +897,19 @@ void wxPropertyGridPageState::DoSetSplitterPosition( int newXPos,
|
|||||||
int splitterColumn,
|
int splitterColumn,
|
||||||
int flags )
|
int flags )
|
||||||
{
|
{
|
||||||
wxPropertyGrid* pg = GetGrid();
|
|
||||||
|
|
||||||
int adjust = newXPos - DoGetSplitterPosition(splitterColumn);
|
int adjust = newXPos - DoGetSplitterPosition(splitterColumn);
|
||||||
|
int otherColumn = splitterColumn + 1;
|
||||||
if ( !pg->HasVirtualWidth() )
|
if ( otherColumn == (int)m_colWidths.size() )
|
||||||
{
|
otherColumn = 0;
|
||||||
// No virtual width
|
if ( adjust > 0 )
|
||||||
int otherColumn;
|
|
||||||
if ( adjust > 0 )
|
|
||||||
{
|
|
||||||
otherColumn = splitterColumn + 1;
|
|
||||||
if ( otherColumn == (int)m_colWidths.size() )
|
|
||||||
otherColumn = 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;
|
m_colWidths[splitterColumn] += adjust;
|
||||||
|
PropagateColSizeDec( otherColumn, adjust, 1 );
|
||||||
|
}
|
||||||
|
else if ( adjust < 0 )
|
||||||
|
{
|
||||||
|
m_colWidths[otherColumn] -= adjust;
|
||||||
|
PropagateColSizeDec( splitterColumn, -adjust, -1 );
|
||||||
}
|
}
|
||||||
// Actual adjustment can be different from demanded.
|
// Actual adjustment can be different from demanded.
|
||||||
newXPos = DoGetSplitterPosition(splitterColumn);
|
newXPos = DoGetSplitterPosition(splitterColumn);
|
||||||
|
Reference in New Issue
Block a user