From bd46f720a1f043b7c29b4278ea3f1f0d650061f4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Sat, 11 Aug 2018 11:26:47 +0200 Subject: [PATCH] Fix a few AUI issues. --- pcbnew/footprint_edit_frame.cpp | 20 +++++++++++++++----- pcbnew/footprint_wizard_frame.cpp | 3 +++ 2 files changed, 18 insertions(+), 5 deletions(-) diff --git a/pcbnew/footprint_edit_frame.cpp b/pcbnew/footprint_edit_frame.cpp index 11a4476e47..2fd464ea6e 100644 --- a/pcbnew/footprint_edit_frame.cpp +++ b/pcbnew/footprint_edit_frame.cpp @@ -695,14 +695,19 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage() // call my base class PCB_BASE_EDIT_FRAME::ShowChangedLanguage(); + // We have 2 panes to update. + // For some obscure reason, the AUI manager hides the first modified pane. + // So force show panes + wxAuiPaneInfo& tree_pane_info = m_auimgr.GetPane( m_treePane ); + bool tree_shown = tree_pane_info.IsShown(); + tree_pane_info.Caption( _( "Footprint Libraries" ) ); + // update the layer manager m_Layers->Freeze(); - wxAuiPaneInfo& pane_info = m_auimgr.GetPane( m_Layers ); - pane_info.Caption( _( "Visibles" ) ); - pane_info = m_auimgr.GetPane( m_treePane ); - pane_info.Caption( _( "Footprint Libraries" ) ); - m_auimgr.Update(); + wxAuiPaneInfo& lm_pane_info = m_auimgr.GetPane( m_Layers ); + bool lm_shown = lm_pane_info.IsShown(); + lm_pane_info.Caption( _( "Visibles" ) ); m_Layers->SetLayersManagerTabsText(); ReFillLayerWidget(); @@ -715,6 +720,11 @@ void FOOTPRINT_EDIT_FRAME::ShowChangedLanguage() m_Layers->OnLayerSelected(); m_Layers->Thaw(); + + // Now restore the visibility: + lm_pane_info.Show( lm_shown ); + tree_pane_info.Show( tree_shown ); + m_auimgr.Update(); } diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index cd755bfdf4..f8569304db 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -216,6 +216,9 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, m_auimgr.LoadPerspective( m_auiPerspective ); + // Ensure the draw panel is shown, regardless the perspective config: + m_auimgr.GetPane( wxT( "DrawFrame" ) ).Show( true ); + // Now Drawpanel is sized, we can use BestZoom to show the component (if any) #ifdef USE_WX_GRAPHICS_CONTEXT GetScreen()->SetScalingFactor( BestZoom() );