mirror of
https://gitlab.com/kicad/code/kicad.git
synced 2025-09-14 18:23:15 +02:00
Prevent command line applications handling dark mode
Double-check before getting background color from invalid m_parent also Fixes https://gitlab.com/kicad/code/kicad/-/issues/21317 (cherry picked from commit 9cb3a37b6f97b58fc1b29411bdc5a55d34603aee)
This commit is contained in:
parent
541a727e15
commit
a4e95c500f
@ -116,7 +116,7 @@ void GRID_CELL_COLOR_RENDERER::Draw( wxGrid& aGrid, wxGridCellAttr& aAttr, wxDC&
|
|||||||
|
|
||||||
void GRID_CELL_COLOR_RENDERER::OnDarkModeToggle()
|
void GRID_CELL_COLOR_RENDERER::OnDarkModeToggle()
|
||||||
{
|
{
|
||||||
m_checkerboardBg = m_parent->GetBackgroundColour();
|
m_checkerboardBg = m_parent ? m_parent->GetBackgroundColour() : wxSystemSettings::GetColour( wxSYS_COLOUR_WINDOW );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -60,6 +60,10 @@ PCB_BASE_EDIT_FRAME::PCB_BASE_EDIT_FRAME( KIWAY* aKiway, wxWindow* aParent,
|
|||||||
{
|
{
|
||||||
m_darkMode = KIPLATFORM::UI::IsDarkTheme();
|
m_darkMode = KIPLATFORM::UI::IsDarkTheme();
|
||||||
|
|
||||||
|
// Do not register the idle event handler if we are running in headless mode.
|
||||||
|
if( !wxApp::GetGUIInstance() )
|
||||||
|
return;
|
||||||
|
|
||||||
Bind( wxEVT_IDLE,
|
Bind( wxEVT_IDLE,
|
||||||
[this]( wxIdleEvent& aEvent )
|
[this]( wxIdleEvent& aEvent )
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user