From b70df18939ba382eb6940f7ecc78e9cb54c13852 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 0018b91e09..ff58ab10af 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 24c48bfc95..f7c8e0526d 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; @@ -283,8 +283,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 );