mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-13 17:53:11 +02:00
Add more parent safety checks
Fixes https://gitlab.com/kicad/code/kicad/-/issues/21317
This commit is contained in:
parent
a7772e3b91
commit
e346139301
@ -326,7 +326,9 @@ void COLOR_SWATCH::GetNewSwatchColor()
|
||||
|
||||
void COLOR_SWATCH::OnDarkModeToggle()
|
||||
{
|
||||
m_checkerboardBg = m_parent->GetBackgroundColour();
|
||||
wxWindow* parent = GetParent();
|
||||
m_checkerboardBg = parent ? parent->GetBackgroundColour() : wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||
|
||||
m_swatch->SetBitmap( makeBitmap() );
|
||||
if( m_swatch )
|
||||
m_swatch->SetBitmap( makeBitmap() );
|
||||
}
|
||||
|
@ -70,7 +70,7 @@ PANEL_ESERIES_DISPLAY::PANEL_ESERIES_DISPLAY( wxWindow * parent, wxWindowID id,
|
||||
// making the value boxes appear to be separated from each other.
|
||||
// Also force text to always be black so it is visible against the light
|
||||
// colored cells in both light and dark modes.
|
||||
wxColour gridLineColour = parent->GetBackgroundColour();
|
||||
wxColour gridLineColour = parent ? parent->GetBackgroundColour() : wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||
|
||||
m_GridEseries112->SetDefaultCellTextColour( *wxBLACK );
|
||||
m_GridEseries112->SetGridLineColour( gridLineColour );
|
||||
|
Loading…
x
Reference in New Issue
Block a user