Set read-only color swatches on first use

(cherry picked from commit 38054953d1)
This commit is contained in:
JamesJCode
2025-01-24 01:21:04 +00:00
parent cdb5dbfae1
commit b39ccfcb77
+8 -12
View File
@@ -191,20 +191,16 @@ void PANEL_COLOR_SETTINGS::OnThemeChanged( wxCommandEvent& event )
void PANEL_COLOR_SETTINGS::updateSwatches()
{
if( m_swatches.empty() )
{
createSwatches();
}
else
{
bool isReadOnly = m_currentSettings->IsReadOnly();
COLOR4D background = m_currentSettings->GetColor( m_backgroundLayer );
for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
{
pair.second->SetSwatchBackground( background );
pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
pair.second->SetReadOnly( isReadOnly );
}
bool isReadOnly = m_currentSettings->IsReadOnly();
COLOR4D background = m_currentSettings->GetColor( m_backgroundLayer );
for( std::pair<int, COLOR_SWATCH*> pair : m_swatches )
{
pair.second->SetSwatchBackground( background );
pair.second->SetSwatchColor( m_currentSettings->GetColor( pair.first ), false );
pair.second->SetReadOnly( isReadOnly );
}
}