From d4c9d9d60aa705059bf8ecf85dcc7f1686f89c7c Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Sun, 21 May 2023 10:54:48 +0100 Subject: [PATCH] Fix issue with colours in the new lazy-loaded preference panels. Fixes https://gitlab.com/kicad/code/kicad/-/issues/14784 Fixes https://gitlab.com/kicad/code/kicad/-/issues/14782 --- common/widgets/wx_treebook.cpp | 6 ++++++ eeschema/dialogs/panel_eeschema_editing_options.cpp | 2 ++ 2 files changed, 8 insertions(+) diff --git a/common/widgets/wx_treebook.cpp b/common/widgets/wx_treebook.cpp index 5207da231d..4acfd04485 100644 --- a/common/widgets/wx_treebook.cpp +++ b/common/widgets/wx_treebook.cpp @@ -58,6 +58,12 @@ public: if( show ) Resolve(); + // m_contents has been created as a child window of LAZY_PAGE, and has been added to + // LAZY_PAGE's m_mainSizer. So wxPanel::Show() should call m_contents' Show() method, + // whether overridden or not. Only it doesn't, so we call it directly here. + if( show && m_contents ) + m_contents->Show( true ); + return wxPanel::Show( show ); } diff --git a/eeschema/dialogs/panel_eeschema_editing_options.cpp b/eeschema/dialogs/panel_eeschema_editing_options.cpp index 4276d3faab..c913f142cb 100644 --- a/eeschema/dialogs/panel_eeschema_editing_options.cpp +++ b/eeschema/dialogs/panel_eeschema_editing_options.cpp @@ -68,9 +68,11 @@ void PANEL_EESCHEMA_EDITING_OPTIONS::loadEEschemaSettings( EESCHEMA_SETTINGS* aC COLOR4D schematicBackground = settings->GetColor( LAYER_SCHEMATIC_BACKGROUND ); m_borderColorSwatch->SetSwatchBackground( schematicBackground ); + m_borderColorSwatch->SetDefaultColor( settings->GetDefaultColor( LAYER_SHEET ) ); m_borderColorSwatch->SetSwatchColor( aCfg->m_Drawing.default_sheet_border_color, false ); m_backgroundColorSwatch->SetSwatchBackground( schematicBackground ); + m_backgroundColorSwatch->SetDefaultColor( settings->GetDefaultColor( LAYER_SHEET_BACKGROUND ) ); m_backgroundColorSwatch->SetSwatchColor( aCfg->m_Drawing.default_sheet_background_color, false ); m_choiceLineMode->SetSelection( aCfg->m_Drawing.line_mode );