Merge PCB_LAYER_WIDGET::SyncRenderStates into ReFillRender

This commit is contained in:
Jon Evans 2018-02-23 10:12:11 -05:00 committed by jean-pierre charras
parent bbad8dc9af
commit a83669ab19
3 changed files with 12 additions and 36 deletions

View File

@ -952,7 +952,7 @@ void PCB_EDIT_FRAME::syncLayerWidgetLayer()
void PCB_EDIT_FRAME::syncRenderStates()
{
m_Layers->SyncRenderStates();
m_Layers->ReFillRender();
}

View File

@ -409,42 +409,25 @@ void PCB_LAYER_WIDGET::ReFillRender()
if( renderRow.id == LAYER_VIA_BBLIND && !settings.m_BlindBuriedViaAllowed )
continue;
renderRow.tooltip = wxGetTranslation( s_render_rows[row].tooltip );
renderRow.rowName = wxGetTranslation( s_render_rows[row].rowName );
if( renderRow.color != COLOR4D::UNSPECIFIED ) // does this row show a color?
if( !renderRow.spacer )
{
// this window frame must have an established BOARD, i.e. after SetBoard()
renderRow.color = myframe->Settings().Colors().GetItemColor( static_cast<GAL_LAYER_ID>( renderRow.id ) );
renderRow.tooltip = wxGetTranslation( s_render_rows[row].tooltip );
renderRow.rowName = wxGetTranslation( s_render_rows[row].rowName );
if( renderRow.color != COLOR4D::UNSPECIFIED ) // does this row show a color?
{
// this window frame must have an established BOARD, i.e. after SetBoard()
renderRow.color = myframe->Settings().Colors().GetItemColor( static_cast<GAL_LAYER_ID>( renderRow.id ) );
}
renderRow.state = board->IsElementVisible( static_cast<GAL_LAYER_ID>( renderRow.id ) );
}
renderRow.state = board->IsElementVisible( static_cast<GAL_LAYER_ID>( renderRow.id ) );
AppendRenderRow( renderRow );
}
}
void PCB_LAYER_WIDGET::SyncRenderStates()
{
BOARD* board = myframe->GetBoard();
for( unsigned row=0; row<DIM(s_render_rows); ++row )
{
int rowId = s_render_rows[row].id;
if( m_fp_editor_mode && !isAllowedInFpMode( rowId ) )
continue;
if( s_render_rows[row].spacer )
continue;
// this does not fire a UI event
SetRenderState( rowId, board->IsElementVisible( static_cast<GAL_LAYER_ID>( rowId ) ) );
}
}
void PCB_LAYER_WIDGET::SyncLayerVisibilities()
{
BOARD* board = myframe->GetBoard();

View File

@ -65,13 +65,6 @@ public:
*/
void ReFillRender();
/**
* Function SyncRenderStates
* updates the checkboxes (checked or not) to be consistent with the current state
* of the visibility of the visible rendering elements.
*/
void SyncRenderStates();
/**
* Function SyncLayerVisibilities
* updates each "Layer" checkbox in this layer widget according