Fix a few issues with builtin color themes

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6754
This commit is contained in:
Jon Evans 2020-12-20 14:41:00 -05:00
parent 71b446f43c
commit 81ce1a07ee
3 changed files with 9 additions and 0 deletions

View File

@ -368,6 +368,7 @@ std::vector<COLOR_SETTINGS*> COLOR_SETTINGS::CreateBuiltinColorSettings()
COLOR_SETTINGS* classicTheme = new COLOR_SETTINGS( wxT( "_builtin_classic" ) );
classicTheme->SetName( _( "KiCad Classic" ) );
classicTheme->m_writeFile = false;
classicTheme->m_params.clear(); // Disable load/store
for( const std::pair<int, COLOR4D> entry : s_classicTheme )
classicTheme->m_colors[entry.first] = entry.second;

View File

@ -66,6 +66,10 @@ PANEL_EESCHEMA_COLOR_SETTINGS::PANEL_EESCHEMA_COLOR_SETTINGS( SCH_BASE_FRAME* aF
EESCHEMA_SETTINGS* app_settings = mgr.GetAppSettings<EESCHEMA_SETTINGS>();
COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
// Saved theme doesn't exist? Reset to default
if( current->GetFilename() != app_settings->m_ColorTheme )
app_settings->m_ColorTheme = current->GetFilename();
createThemeList( app_settings->m_ColorTheme );
m_optOverrideColors->SetValue( current->GetOverrideSchItemColors() );

View File

@ -382,6 +382,10 @@ PANEL_PCBNEW_COLOR_SETTINGS::PANEL_PCBNEW_COLOR_SETTINGS( PCB_EDIT_FRAME* aFrame
PCBNEW_SETTINGS* app_settings = mgr.GetAppSettings<PCBNEW_SETTINGS>();
COLOR_SETTINGS* current = mgr.GetColorSettings( app_settings->m_ColorTheme );
// Saved theme doesn't exist? Reset to default
if( current->GetFilename() != app_settings->m_ColorTheme )
app_settings->m_ColorTheme = current->GetFilename();
createThemeList( app_settings->m_ColorTheme );
// Currently this only applies to eeschema