Make sure color settings are saved when modified.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17864
This commit is contained in:
Jeff Young 2024-04-27 13:29:44 +01:00
parent e478c4db2e
commit 3b3de58e5e
2 changed files with 3 additions and 1 deletions

View File

@ -708,6 +708,8 @@ void BOARD_ADAPTER::SetLayerColors( const std::map<int, COLOR4D>& aColors )
for( const auto& [ layer, color ] : aColors ) for( const auto& [ layer, color ] : aColors )
settings->SetColor( layer, color ); settings->SetColor( layer, color );
Pgm().GetSettingsManager().SaveColorSettings( settings, "3d_viewer" );
} }

View File

@ -36,7 +36,7 @@ const wxString COLOR_SETTINGS::COLOR_BUILTIN_CLASSIC = "_builtin_classic";
COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) : COLOR_SETTINGS::COLOR_SETTINGS( const wxString& aFilename, bool aAbsolutePath ) :
JSON_SETTINGS( std::move( aFilename ), SETTINGS_LOC::COLORS, colorsSchemaVersion ), JSON_SETTINGS( aFilename, SETTINGS_LOC::COLORS, colorsSchemaVersion ),
m_overrideSchItemColors( false ) m_overrideSchItemColors( false )
{ {
if( aAbsolutePath ) if( aAbsolutePath )