Read and update colour settings when changed in prefs.
Fixes https://gitlab.com/kicad/code/kicad/issues/5046
This commit is contained in:
parent
7108a25278
commit
07ab97a58b
|
@ -64,6 +64,7 @@ void WS_RENDER_SETTINGS::LoadColors( const COLOR_SETTINGS* aSettings )
|
||||||
|
|
||||||
m_backgroundColor = aSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
m_backgroundColor = aSettings->GetColor( LAYER_SCHEMATIC_BACKGROUND );
|
||||||
m_pageBorderColor = aSettings->GetColor( LAYER_SCHEMATIC_GRID );
|
m_pageBorderColor = aSettings->GetColor( LAYER_SCHEMATIC_GRID );
|
||||||
|
m_normalColor = aSettings->GetColor( LAYER_SCHEMATIC_WORKSHEET );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -51,9 +51,9 @@ PL_DRAW_PANEL_GAL::PL_DRAW_PANEL_GAL( wxWindow* aParentWindow, wxWindowID aWindo
|
||||||
|
|
||||||
m_painter = std::make_unique<KIGFX::WS_PAINTER>( m_gal );
|
m_painter = std::make_unique<KIGFX::WS_PAINTER>( m_gal );
|
||||||
|
|
||||||
auto cfg = Pgm().GetSettingsManager().GetAppSettings<PL_EDITOR_SETTINGS>();
|
SETTINGS_MANAGER& settingsManager = Pgm().GetSettingsManager();
|
||||||
m_painter->GetSettings()->LoadColors(
|
PL_EDITOR_SETTINGS* cfg = settingsManager.GetAppSettings<PL_EDITOR_SETTINGS>();
|
||||||
Pgm().GetSettingsManager().GetColorSettings( cfg->m_ColorTheme ) );
|
m_painter->GetSettings()->LoadColors( settingsManager.GetColorSettings( cfg->m_ColorTheme ) );
|
||||||
|
|
||||||
m_view->SetPainter( m_painter.get() );
|
m_view->SetPainter( m_painter.get() );
|
||||||
m_view->SetScaleLimits( 20.0, 0.05 ); // This fixes the zoom in and zoom out limits
|
m_view->SetScaleLimits( 20.0, 0.05 ); // This fixes the zoom in and zoom out limits
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
#include <fctsys.h>
|
#include <fctsys.h>
|
||||||
#include <kiface_i.h>
|
#include <kiface_i.h>
|
||||||
#include <pgm_base.h>
|
#include <pgm_base.h>
|
||||||
#include <base_units.h>
|
//#include <base_units.h>
|
||||||
#include <msgpanel.h>
|
#include <msgpanel.h>
|
||||||
#include <bitmaps.h>
|
#include <bitmaps.h>
|
||||||
#include <dialogs/panel_pl_editor_color_settings.h>
|
#include <dialogs/panel_pl_editor_color_settings.h>
|
||||||
|
@ -57,6 +57,7 @@
|
||||||
#include <invoke_pl_editor_dialog.h>
|
#include <invoke_pl_editor_dialog.h>
|
||||||
#include <tools/pl_editor_control.h>
|
#include <tools/pl_editor_control.h>
|
||||||
#include <widgets/infobar.h>
|
#include <widgets/infobar.h>
|
||||||
|
#include <settings/settings_manager.h>
|
||||||
|
|
||||||
BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
|
BEGIN_EVENT_TABLE( PL_EDITOR_FRAME, EDA_DRAW_FRAME )
|
||||||
EVT_CLOSE( PL_EDITOR_FRAME::OnCloseWindow )
|
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<PL_EDITOR_SETTINGS>();
|
||||||
|
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
|
wxPoint PL_EDITOR_FRAME::ReturnCoordOriginCorner() const
|
||||||
{
|
{
|
||||||
// calculate the position (in page, in iu) of the corner used as coordinate origin
|
// calculate the position (in page, in iu) of the corner used as coordinate origin
|
||||||
|
|
|
@ -136,6 +136,8 @@ public:
|
||||||
const TITLE_BLOCK& GetTitleBlock() const override;
|
const TITLE_BLOCK& GetTitleBlock() const override;
|
||||||
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
|
void SetTitleBlock( const TITLE_BLOCK& aTitleBlock ) override;
|
||||||
|
|
||||||
|
void CommonSettingsChanged( bool aEnvVarsChanged, bool aTextVarsChanged ) override;
|
||||||
|
|
||||||
void DisplayGridMsg() override;
|
void DisplayGridMsg() override;
|
||||||
|
|
||||||
void UpdateStatusBar() override;
|
void UpdateStatusBar() override;
|
||||||
|
|
Loading…
Reference in New Issue