Make sure SCH-related frames use the schematic worksheet color.

Fixes https://gitlab.com/kicad/code/kicad/issues/6843
This commit is contained in:
Jeff Young 2020-12-25 16:58:57 +00:00
parent 7a081b7c04
commit 0d57f90982
2 changed files with 20 additions and 10 deletions

View File

@ -653,6 +653,15 @@ void DIALOG_PAGES_SETTINGS::UpdatePageLayoutExample()
renderSettings.LoadColors( colorSettings );
renderSettings.SetPrintDC( &memDC );
if( m_parent->IsType( FRAME_SCH )
|| m_parent->IsType( FRAME_SCH_SYMBOL_EDITOR )
|| m_parent->IsType( FRAME_SCH_VIEWER )
|| m_parent->IsType( FRAME_SCH_VIEWER_MODAL ) )
{
COLOR4D worksheetColor = renderSettings.GetLayerColor( LAYER_SCHEMATIC_WORKSHEET );
renderSettings.SetLayerColor( LAYER_WORKSHEET, worksheetColor );
}
GRFilledRect( NULL, &memDC, 0, 0, m_layout_size.x, m_layout_size.y, bgColor, bgColor );
PrintPageLayout( &renderSettings, pageDUMMY, emptyString, emptyString, m_tb,
@ -783,12 +792,13 @@ void DIALOG_PAGES_SETTINGS::OnWksFileSelection( wxCommandEvent& event )
// For Win/Linux/macOS compatibility, a relative path is a good idea
if( shortFileName != GetWksFileName() && shortFileName != fileName )
{
wxString msg = wxString::Format( _(
"The page layout description file name has changed.\n"
wxString msg = wxString::Format( _( "The page layout description file name has changed.\n"
"Do you want to use the relative path:\n"
"\"%s\"\n"
"instead of\n"
"\"%s\"?" ), shortFileName, fileName );
"\"%s\"?" ),
shortFileName,
fileName );
if( !IsOK( this, msg ) )
shortFileName = fileName;