Browse Source

Merge PCB_LAYER_WIDGET::SyncRenderStates into ReFillRender

pull/5/merge
Jon Evans 8 years ago
committed by jean-pierre charras
parent
commit
a83669ab19
  1. 2
      pcbnew/pcb_edit_frame.cpp
  2. 39
      pcbnew/pcb_layer_widget.cpp
  3. 7
      pcbnew/pcb_layer_widget.h

2
pcbnew/pcb_edit_frame.cpp

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

39
pcbnew/pcb_layer_widget.cpp

@ -409,38 +409,21 @@ void PCB_LAYER_WIDGET::ReFillRender()
if( renderRow.id == LAYER_VIA_BBLIND && !settings.m_BlindBuriedViaAllowed ) if( renderRow.id == LAYER_VIA_BBLIND && !settings.m_BlindBuriedViaAllowed )
continue; 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.state = board->IsElementVisible( static_cast<GAL_LAYER_ID>( renderRow.id ) );
AppendRenderRow( renderRow );
}
}
void PCB_LAYER_WIDGET::SyncRenderStates()
{
BOARD* board = myframe->GetBoard();
renderRow.tooltip = wxGetTranslation( s_render_rows[row].tooltip );
renderRow.rowName = wxGetTranslation( s_render_rows[row].rowName );
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( 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 ) );
}
if( s_render_rows[row].spacer )
continue;
renderRow.state = board->IsElementVisible( static_cast<GAL_LAYER_ID>( renderRow.id ) );
}
// this does not fire a UI event
SetRenderState( rowId, board->IsElementVisible( static_cast<GAL_LAYER_ID>( rowId ) ) );
AppendRenderRow( renderRow );
} }
} }

7
pcbnew/pcb_layer_widget.h

@ -65,13 +65,6 @@ public:
*/ */
void ReFillRender(); 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 * Function SyncLayerVisibilities
* updates each "Layer" checkbox in this layer widget according * updates each "Layer" checkbox in this layer widget according

Loading…
Cancel
Save