Only update the layer icon bitmap when it has actually changed
This was causing unnecessary calls to refresh the toolbar, causing flickering in the layer widget. Fixes https://gitlab.com/kicad/code/kicad/-/issues/5212
This commit is contained in:
parent
5b365053db
commit
cff76e55d5
|
@ -200,12 +200,12 @@ void PCB_EDIT_FRAME::PrepareLayerIndicator( bool aForceRebuild )
|
||||||
wxIMAGE_QUALITY_NEAREST );
|
wxIMAGE_QUALITY_NEAREST );
|
||||||
|
|
||||||
LayerPairBitmap = std::make_unique<wxBitmap>( image );
|
LayerPairBitmap = std::make_unique<wxBitmap>( image );
|
||||||
}
|
|
||||||
|
|
||||||
if( m_mainToolBar )
|
if( m_mainToolBar )
|
||||||
{
|
{
|
||||||
m_mainToolBar->SetToolBitmap( PCB_ACTIONS::selectLayerPair, *LayerPairBitmap );
|
m_mainToolBar->SetToolBitmap( PCB_ACTIONS::selectLayerPair, *LayerPairBitmap );
|
||||||
m_mainToolBar->Refresh();
|
m_mainToolBar->Refresh();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -662,5 +662,6 @@ void PCB_EDIT_FRAME::OnUpdateSelectViaSize( wxUpdateUIEvent& aEvent )
|
||||||
|
|
||||||
void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
|
void PCB_EDIT_FRAME::OnUpdateLayerSelectBox( wxUpdateUIEvent& aEvent )
|
||||||
{
|
{
|
||||||
m_SelLayerBox->SetLayerSelection( GetActiveLayer() );
|
if( m_SelLayerBox->GetLayerSelection() != GetActiveLayer() )
|
||||||
|
m_SelLayerBox->SetLayerSelection( GetActiveLayer() );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue