From 36d716bb5021a8c0733fdc0ad32897e6e68d7402 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Wed, 22 Apr 2020 23:14:42 +0100 Subject: [PATCH] Update toolbars when changing units. Fixes: lp:4249 * https://bugs.launchpad.net/kicad/+bug/4249 --- common/legacy_gal/eda_draw_frame.cpp | 4 ++++ common/legacy_wx/eda_draw_frame.cpp | 3 +++ pcbnew/tool_pcb_editor.cpp | 1 + 3 files changed, 8 insertions(+) diff --git a/common/legacy_gal/eda_draw_frame.cpp b/common/legacy_gal/eda_draw_frame.cpp index f1c385221d..e4df328a7f 100644 --- a/common/legacy_gal/eda_draw_frame.cpp +++ b/common/legacy_gal/eda_draw_frame.cpp @@ -268,6 +268,7 @@ bool EDA_DRAW_FRAME::LockFile( const wxString& aFileName ) void EDA_DRAW_FRAME::unitsChangeRefresh() { + ReCreateAuxiliaryToolbar(); UpdateStatusBar(); UpdateMsgPanel(); } @@ -298,6 +299,8 @@ void EDA_DRAW_FRAME::CommonSettingsChanged() m_canvas->SetEnableAutoPan( option ); m_galDisplayOptions.ReadCommonConfig( *settings, this ); + + ReCreateAuxiliaryToolbar(); } @@ -428,6 +431,7 @@ void EDA_DRAW_FRAME::OnUpdateUnits( wxUpdateUIEvent& aEvent ) aEvent.Check( enable ); DisplayUnitsMsg(); + ReCreateAuxiliaryToolbar(); } diff --git a/common/legacy_wx/eda_draw_frame.cpp b/common/legacy_wx/eda_draw_frame.cpp index 9a54692c78..d7170bfdc9 100644 --- a/common/legacy_wx/eda_draw_frame.cpp +++ b/common/legacy_wx/eda_draw_frame.cpp @@ -271,6 +271,7 @@ bool EDA_DRAW_FRAME::LockFile( const wxString& aFileName ) void EDA_DRAW_FRAME::unitsChangeRefresh() { + ReCreateAuxiliaryToolbar(); UpdateStatusBar(); UpdateMsgPanel(); } @@ -300,6 +301,8 @@ void EDA_DRAW_FRAME::CommonSettingsChanged() m_canvas->SetEnableAutoPan( option ); m_galDisplayOptions.ReadCommonConfig( *settings, this ); + + ReCreateAuxiliaryToolbar(); } diff --git a/pcbnew/tool_pcb_editor.cpp b/pcbnew/tool_pcb_editor.cpp index c7dbdc645a..46702d26d8 100644 --- a/pcbnew/tool_pcb_editor.cpp +++ b/pcbnew/tool_pcb_editor.cpp @@ -574,6 +574,7 @@ void PCB_EDIT_FRAME::ReCreateAuxiliaryToolbar() { UpdateTrackWidthSelectBox( m_SelTrackWidthBox ); UpdateViaSizeSelectBox( m_SelViaSizeBox ); + UpdateGridSelectBox(); // combobox sizes can have changed: apply new best sizes wxAuiToolBarItem* item = m_auxiliaryToolBar->FindTool( ID_AUX_TOOLBAR_PCB_TRACK_WIDTH );