Eeschema, panel color settings: minor fix: ensure color swatches are show/hidden

according to the option Override Colors state.
This commit is contained in:
jean-pierre charras 2023-05-21 13:55:00 +02:00
parent c2e019b773
commit c08f482ed4
2 changed files with 10 additions and 3 deletions

View File

@ -223,6 +223,7 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::createSwatches()
m_colorsMainSizer->Layout();
updateAllowedSwatches();
createPreviewItems();
updatePreview();
zoomFitPreview();
@ -519,10 +520,8 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::OnSize( wxSizeEvent& aEvent )
}
void PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked( wxCommandEvent& aEvent )
void PANEL_EESCHEMA_COLOR_SETTINGS::updateAllowedSwatches()
{
m_currentSettings->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
// If the theme is not overriding individual item colors then don't show them so that
// the user doesn't get seduced into thinking they'll have some effect.
m_labels[ LAYER_SHEET ]->Show( m_currentSettings->GetOverrideSchItemColors() );
@ -534,3 +533,10 @@ void PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked( wxCommandEvent&
m_colorsGridSizer->Layout();
m_colorsListWindow->Layout();
}
void PANEL_EESCHEMA_COLOR_SETTINGS::OnOverrideItemColorsClicked( wxCommandEvent& aEvent )
{
m_currentSettings->SetOverrideSchItemColors( m_optOverrideColors->GetValue() );
updateAllowedSwatches();
}

View File

@ -61,6 +61,7 @@ private:
void createPreviewItems();
void updatePreview();
void updateAllowedSwatches();
void zoomFitPreview();
private: