Calculate weighted column width locally
Multiplying the global variable also modifies all columns to the right, which is not a problem right now because none exist, but might be in the future.
This commit is contained in:
parent
add082548d
commit
d6c6116e67
|
@ -116,13 +116,15 @@ PANEL_SETUP_NETCLASSES::PANEL_SETUP_NETCLASSES( PAGED_DIALOG* aParent, EDA_DRAW_
|
||||||
// as this initial width is sometimes strange depending on the language (wxGrid bug?)
|
// as this initial width is sometimes strange depending on the language (wxGrid bug?)
|
||||||
int min_width = m_netclassGrid->GetVisibleWidth( i, true, true );
|
int min_width = m_netclassGrid->GetVisibleWidth( i, true, true );
|
||||||
|
|
||||||
if( i == GRID_LINESTYLE )
|
int weighted_min_best_width =
|
||||||
min_best_width *= 1.5;
|
( i == GRID_LINESTYLE )
|
||||||
|
? min_best_width * 3 / 2
|
||||||
|
: min_best_width;
|
||||||
|
|
||||||
m_netclassGrid->SetColMinimalWidth( i, min_width );
|
m_netclassGrid->SetColMinimalWidth( i, min_width );
|
||||||
|
|
||||||
// We use a "best size" >= min_best_width
|
// We use a "best size" >= min_best_width
|
||||||
m_originalColWidths[ i ] = std::max( min_width, min_best_width );
|
m_originalColWidths[ i ] = std::max( min_width, weighted_min_best_width );
|
||||||
m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
|
m_netclassGrid->SetColSize( i, m_originalColWidths[ i ] );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue