From 2e07d83461a35940e7f7172e649db5795fd56cd0 Mon Sep 17 00:00:00 2001 From: Chris Pavlina Date: Sun, 19 Feb 2017 14:54:36 -0500 Subject: [PATCH] Reduce footprint preview flickering in component selector --- common/widgets/footprint_preview_panel.cpp | 3 +++ pcbnew/footprint_preview_panel.cpp | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/widgets/footprint_preview_panel.cpp b/common/widgets/footprint_preview_panel.cpp index d75788c161..782920c2ca 100644 --- a/common/widgets/footprint_preview_panel.cpp +++ b/common/widgets/footprint_preview_panel.cpp @@ -40,6 +40,9 @@ FOOTPRINT_PREVIEW_PANEL* FOOTPRINT_PREVIEW_PANEL::InstallOnPanel( return NULL; } + aPanel->SetBackgroundColour( *wxBLACK ); + aPanel->SetForegroundColour( *wxWHITE ); + auto sizer = new wxBoxSizer( wxVERTICAL ); sizer->Add( fpp, 1, wxALL | wxEXPAND, 0 ); diff --git a/pcbnew/footprint_preview_panel.cpp b/pcbnew/footprint_preview_panel.cpp index b46a1b12c5..17873a5f00 100644 --- a/pcbnew/footprint_preview_panel.cpp +++ b/pcbnew/footprint_preview_panel.cpp @@ -199,6 +199,7 @@ FOOTPRINT_PREVIEW_PANEL::CacheFootprint ( const LIB_ID& aFPID ) void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module ) { + Freeze(); GetView()->Clear(); module->SetParent ( &*m_dummyBoard ); module->RunOnChildren( boost::bind( &KIGFX::VIEW::Add, GetView(), _1 ) ); @@ -214,7 +215,6 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module ) if( bbox.GetSize().x > 0 && bbox.GetSize().y > 0 ) { - // Autozoom GetView()->SetViewport( BOX2D( bbox.GetOrigin(), bbox.GetSize() ) ); @@ -223,6 +223,8 @@ void FOOTPRINT_PREVIEW_PANEL::renderFootprint( MODULE *module ) Refresh(); } + + Thaw(); } @@ -275,6 +277,7 @@ void FOOTPRINT_PREVIEW_PANEL::OnLoaderThreadUpdate( wxCommandEvent& event ) void FOOTPRINT_PREVIEW_PANEL::SetStatusText( wxString const & aText ) { + Freeze(); if( m_label ) { m_label->SetLabel( aText ); @@ -287,11 +290,13 @@ void FOOTPRINT_PREVIEW_PANEL::SetStatusText( wxString const & aText ) } GetParent()->Layout(); + Thaw(); } void FOOTPRINT_PREVIEW_PANEL::ClearStatus() { + Freeze(); if( m_label ) { m_label->SetLabel( wxEmptyString ); @@ -304,6 +309,7 @@ void FOOTPRINT_PREVIEW_PANEL::ClearStatus() } GetParent()->Layout(); + Thaw(); }