diff --git a/pcbnew/pcb_edit_frame.cpp b/pcbnew/pcb_edit_frame.cpp index dd3c79398e..81fca729f6 100644 --- a/pcbnew/pcb_edit_frame.cpp +++ b/pcbnew/pcb_edit_frame.cpp @@ -952,7 +952,7 @@ void PCB_EDIT_FRAME::syncLayerWidgetLayer() void PCB_EDIT_FRAME::syncRenderStates() { - m_Layers->SyncRenderStates(); + m_Layers->ReFillRender(); } diff --git a/pcbnew/pcb_layer_widget.cpp b/pcbnew/pcb_layer_widget.cpp index fcf5b5f73a..ff8bc949e5 100644 --- a/pcbnew/pcb_layer_widget.cpp +++ b/pcbnew/pcb_layer_widget.cpp @@ -409,38 +409,21 @@ 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( renderRow.id ) ); - } - - renderRow.state = board->IsElementVisible( static_cast( 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; rowSettings().Colors().GetItemColor( static_cast( renderRow.id ) ); + } - if( s_render_rows[row].spacer ) - continue; + renderRow.state = board->IsElementVisible( static_cast( renderRow.id ) ); + } - // this does not fire a UI event - SetRenderState( rowId, board->IsElementVisible( static_cast( rowId ) ) ); + AppendRenderRow( renderRow ); } } diff --git a/pcbnew/pcb_layer_widget.h b/pcbnew/pcb_layer_widget.h index 04751872b1..5c80d8da14 100644 --- a/pcbnew/pcb_layer_widget.h +++ b/pcbnew/pcb_layer_widget.h @@ -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