diff --git a/common/page_layout/ws_painter.cpp b/common/page_layout/ws_painter.cpp index 7898511c77..bd41205894 100644 --- a/common/page_layout/ws_painter.cpp +++ b/common/page_layout/ws_painter.cpp @@ -64,6 +64,7 @@ void WS_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings ) m_backgroundColor = aSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND ); m_pageBorderColor = aSettings->GetColor( LAYER_SCHEMATIC_GRID ); + m_normalColor = aSettings->GetColor( LAYER_SCHEMATIC_WORKSHEET ); } diff --git a/include/ws_painter.h b/include/ws_painter.h index 472cb9a8d9..24889bc2a6 100644 --- a/include/ws_painter.h +++ b/include/ws_painter.h @@ -44,7 +44,7 @@ namespace KIGFX * WS_RENDER_SETTINGS * Stores page-layout-specific render settings. */ -class WS_RENDER_SETTINGS : public RENDER_SETTINGS +class WS_RENDER_SETTINGS : public RENDER_SETTINGS { public: friend class WS_PAINTER; diff --git a/pagelayout_editor/pl_draw_panel_gal.cpp b/pagelayout_editor/pl_draw_panel_gal.cpp index 76ba753bff..a8f370a952 100644 --- a/pagelayout_editor/pl_draw_panel_gal.cpp +++ b/pagelayout_editor/pl_draw_panel_gal.cpp @@ -51,9 +51,9 @@ PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindo m_painter = std::make_unique( m_gal ); - auto cfg = Pgm().GetSettingsManager().GetAppSettings(); - m_painter->GetSettings()->LoadColors( - Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme ) ); + SETTINGS_MANAGER& settingsManager = Pgm().GetSettingsManager(); + PL_EDITOR_SETTINGS* cfg = settingsManager.GetAppSettings(); + m_painter->GetSettings()->LoadColors( settingsManager.GetColorSettings( cfg->m_ColorTheme ) ); m_view->SetPainter( m_painter.get() ); m_view->SetScaleLimits( 20.0, 0.05 ); // This fixes the zoom in and zoom out limits diff --git a/pagelayout_editor/pl_editor_frame.cpp b/pagelayout_editor/pl_editor_frame.cpp index 29bb4d685a..8e8e266f13 100644 --- a/pagelayout_editor/pl_editor_frame.cpp +++ b/pagelayout_editor/pl_editor_frame.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +//#include #include #include #include @@ -57,6 +57,7 @@ #include #include #include +#include BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME ) EVT_CLOSE( PL_EDITOR_FRAME::OnCloseWindow ) @@ -550,6 +551,21 @@ void PL_EDITOR_FRAME::SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) } +void PL_EDITOR_FRAME::CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) +{ + EDA_DRAW_FRAME::CommonSettingsChanged( aEnvVarsChanged, aTextVarsChanged ); + + SETTINGS_MANAGER& settingsManager = Pgm().GetSettingsManager(); + PL_EDITOR_SETTINGS* cfg = settingsManager.GetAppSettings(); + COLOR_SETTINGS* colors = settingsManager.GetColorSettings( cfg->m_ColorTheme ); + + GetCanvas()->GetView()->GetPainter()->GetSettings()->LoadColors( colors ); + + GetCanvas()->GetView()->UpdateAllItems( KIGFX::COLOR ); + GetCanvas()->Refresh(); +} + + wxPoint PL_EDITOR_FRAME::ReturnCoordOriginCorner() const { // calculate the position (in page, in iu) of the corner used as coordinate origin diff --git a/pagelayout_editor/pl_editor_frame.h b/pagelayout_editor/pl_editor_frame.h index 363d156326..d45fc4e98c 100644 --- a/pagelayout_editor/pl_editor_frame.h +++ b/pagelayout_editor/pl_editor_frame.h @@ -136,6 +136,8 @@ public: const TITLE_BLOCK& GetTitleBlock() const override; void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override; + void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override; + void DisplayGridMsg() override; void UpdateStatusBar() override;