mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 10:13:19 +02:00
Don't presume a selection.
This commit is contained in:
parent
66921b5026
commit
eb877a2fb4
@ -92,8 +92,11 @@ bool PANEL_COLOR_SETTINGS::Show( bool show )
|
|||||||
if( show )
|
if( show )
|
||||||
{
|
{
|
||||||
// In case changes have been made to the current theme in another panel:
|
// In case changes have been made to the current theme in another panel:
|
||||||
int idx = m_cbTheme->GetSelection();
|
int themeSel = m_cbTheme->GetSelection();
|
||||||
COLOR_SETTINGS* settings = static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( idx ) );
|
|
||||||
|
if( themeSel >= 0 )
|
||||||
|
{
|
||||||
|
COLOR_SETTINGS* settings = static_cast<COLOR_SETTINGS*>( m_cbTheme->GetClientData( themeSel ) );
|
||||||
|
|
||||||
if( settings )
|
if( settings )
|
||||||
*m_currentSettings = *settings;
|
*m_currentSettings = *settings;
|
||||||
@ -101,6 +104,7 @@ bool PANEL_COLOR_SETTINGS::Show( bool show )
|
|||||||
onNewThemeSelected();
|
onNewThemeSelected();
|
||||||
updateSwatches();
|
updateSwatches();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return PANEL_COLOR_SETTINGS_BASE::Show( show );
|
return PANEL_COLOR_SETTINGS_BASE::Show( show );
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user