Use the eeschema color theme for the symbol preview canvas

Fixes https://gitlab.com/kicad/code/kicad/-/issues/4484
This commit is contained in:
Jon Evans 2020-05-18 17:47:22 -04:00
parent 7d537e83ea
commit 5a9e69b146
1 changed files with 4 additions and 0 deletions

View File

@ -66,6 +66,10 @@ SYMBOL_PREVIEW_WIDGET::SYMBOL_PREVIEW_WIDGET( wxWindow* aParent, KIWAY& aKiway,
// before any OnPaint event is fired for the canvas using a wrong bg color // before any OnPaint event is fired for the canvas using a wrong bg color
KIGFX::VIEW* view = m_preview->GetView(); KIGFX::VIEW* view = m_preview->GetView();
auto settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() ); auto settings = static_cast<KIGFX::SCH_RENDER_SETTINGS*>( view->GetPainter()->GetSettings() );
if( auto* theme = Pgm().GetSettingsManager().GetColorSettings( app_settings->m_ColorTheme ) )
settings->LoadColors( theme );
m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() ); m_preview->GetGAL()->SetClearColor( settings->GetBackgroundColor() );
SetBackgroundColour( *wxWHITE ); SetBackgroundColour( *wxWHITE );