Pcbnew, layer manager: fix flicker when loading a file, and incorrect size on start when no file is loaded

Fixes: lp:1840591
https://bugs.launchpad.net/kicad/+bug/1840591
This commit is contained in:
jean-pierre charras 2019-08-19 10:42:22 +02:00
parent 416f93175d
commit b25ffc0aa8
2 changed files with 8 additions and 1 deletions

View File

@ -50,6 +50,8 @@
#include <build_version.h> // LEGACY_BOARD_FILE_VERSION
#include <wx/stdpaths.h>
#include <pcb_layer_widget.h>
#include <wx/wupdlock.h>
//#define USE_INSTRUMENTATION 1
@ -446,6 +448,8 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
return false;
}
wxWindowUpdateLocker no_update( m_Layers ); // Avoid flicker when rebuilding m_Layers
Clear_Pcb( false ); // pass false since we prompted above for a modified board
IO_MGR::PCB_FILE_T pluginType = plugin_type( fullFileName, aCtl );

View File

@ -85,6 +85,7 @@
#include <board_netlist_updater.h>
#include <netlist_reader.h>
#include <pcb_netlist.h>
#include <wx/wupdlock.h>
#if defined(KICAD_SCRIPTING) || defined(KICAD_SCRIPTING_WXPYTHON)
#include <python_scripting.h>
@ -255,8 +256,9 @@ PCB_EDIT_FRAME::PCB_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent ) :
m_auimgr.GetPane( "LayersManager" ).Show( m_show_layer_manager_tools );
m_auimgr.GetPane( "MicrowaveToolbar" ).Show( m_show_microwave_tools );
ReFillLayerWidget(); // this is near end because contents establish size
m_Layers->ReFillRender(); // Update colors in Render after the config is read
ReFillLayerWidget(); // this is near end and after ReFillRender()
// because contents establish size
syncLayerWidgetLayer();
m_auimgr.Update();
@ -432,6 +434,7 @@ void PCB_EDIT_FRAME::setupTools()
void PCB_EDIT_FRAME::ReFillLayerWidget()
{
wxWindowUpdateLocker no_update( m_Layers );
m_Layers->ReFill();
wxAuiPaneInfo& lyrs = m_auimgr.GetPane( m_Layers );