From ba2547efaf3991313a5ed4dc351e5f35986e2416 Mon Sep 17 00:00:00 2001 From: Ian McInerney Date: Mon, 29 Jul 2019 00:39:24 +0200 Subject: [PATCH] pcbnew: Force rebuild of layer pair icon on menu creation Fixes: lp:1838158 * https://bugs.launchpad.net/kicad/+bug/1838158 --- pcbnew/pcb_edit_frame.h | 2 +- pcbnew/toolbars_pcb_editor.cpp | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pcbnew/pcb_edit_frame.h b/pcbnew/pcb_edit_frame.h index 0018b91e0..ff58ab10a 100644 --- a/pcbnew/pcb_edit_frame.h +++ b/pcbnew/pcb_edit_frame.h @@ -554,7 +554,7 @@ public: /* toolbars update UI functions: */ - void PrepareLayerIndicator(); + void PrepareLayerIndicator( bool aForceRebuild = false ); void ToggleLayersManager(); void ToggleMicrowaveToolbar(); diff --git a/pcbnew/toolbars_pcb_editor.cpp b/pcbnew/toolbars_pcb_editor.cpp index cdba7625b..5eb0da0cc 100644 --- a/pcbnew/toolbars_pcb_editor.cpp +++ b/pcbnew/toolbars_pcb_editor.cpp @@ -84,11 +84,11 @@ static const char s_BitmapLayerIcon[BM_LAYERICON_SIZE][BM_LAYERICON_SIZE] = }; -void PCB_EDIT_FRAME::PrepareLayerIndicator() +void PCB_EDIT_FRAME::PrepareLayerIndicator( bool aForceRebuild ) { int ii, jj; COLOR4D active_layer_color, top_color, bottom_color, via_color, background_color; - bool change = false; + bool change = aForceRebuild; static int previous_requested_scale; static COLOR4D previous_active_layer_color = COLOR4D::UNSPECIFIED; @@ -284,8 +284,8 @@ void PCB_EDIT_FRAME::ReCreateHToolbar() m_mainToolBar->AddControl( m_SelLayerBox ); m_mainToolBar->Add( PCB_ACTIONS::selectLayerPair ); - PrepareLayerIndicator(); // Initialize the bitmap with the active layer colors - + PrepareLayerIndicator( true ); // Force rebuild of the bitmap with the active layer colors + KiScaledSeparator( m_mainToolBar, this ); m_mainToolBar->Add( PCB_ACTIONS::showEeschema ); -- 2.21.0