pcbnew: Adjust footprint properties columns

Size based on text width in 3d and check for overflow before expanding
the first column.
This commit is contained in:
Seth Hillbrand 2019-02-14 22:09:01 -08:00
parent 8b46c99c60
commit 5e5167f198
1 changed files with 4 additions and 1 deletions

View File

@ -391,6 +391,7 @@ bool DIALOG_FOOTPRINT_BOARD_EDITOR::TransferDataToWindow()
}
m_itemsGrid->SetRowLabelSize( m_itemsGrid->GetVisibleWidth( -1, false, true, true ) );
m_modelsGrid->SetColSize( 1, m_modelsGrid->GetVisibleWidth( 1, true, false, false ) );
Layout();
adjustGridColumns( m_itemsGrid->GetRect().GetWidth());
@ -826,7 +827,9 @@ void DIALOG_FOOTPRINT_BOARD_EDITOR::adjustGridColumns( int aWidth )
for( int i = 1; i < m_itemsGrid->GetNumberCols(); i++ )
itemsWidth -= m_itemsGrid->GetColSize( i );
m_itemsGrid->SetColSize( 0, std::max( itemsWidth, 120 ) );
if( itemsWidth > 0 )
m_itemsGrid->SetColSize( 0, std::max( itemsWidth,
m_itemsGrid->GetVisibleWidth( 0, true, false, false ) ) );
m_modelsGrid->SetColSize( 0, modelsWidth - m_modelsGrid->GetColSize( 1 ) - 5 );
}