Tidy up shutdown of APPEARANCE_CONTROLS.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/15024
This commit is contained in:
Jeff Young 2023-09-24 18:26:42 +01:00
parent d428b0e20e
commit c2c71facb1
3 changed files with 14 additions and 6 deletions

View File

@ -1335,6 +1335,9 @@ void PCB_EDIT_FRAME::SaveSettings( APP_SETTINGS_BASE* aCfg )
cfg->m_AuiPanels.search_panel_height = m_searchPane->GetSize().y;
cfg->m_AuiPanels.search_panel_width = m_searchPane->GetSize().x;
cfg->m_AuiPanels.search_panel_dock_direction = searchPaneInfo.dock_direction;
if( m_appearancePanel )
m_appearancePanel->SaveSettings( cfg );
}
}

View File

@ -592,15 +592,17 @@ APPEARANCE_CONTROLS::APPEARANCE_CONTROLS( PCB_BASE_FRAME* aParent, wxWindow* aFo
APPEARANCE_CONTROLS::~APPEARANCE_CONTROLS()
{
PCBNEW_SETTINGS* settings = m_frame->GetPcbNewSettings();
settings->m_AuiPanels.appearance_expand_layer_display = m_paneLayerDisplayOptions->IsExpanded();
settings->m_AuiPanels.appearance_expand_net_display = m_paneNetDisplayOptions->IsExpanded();
delete m_iconProvider;
}
void APPEARANCE_CONTROLS::SaveSettings( PCBNEW_SETTINGS* aCfg )
{
aCfg->m_AuiPanels.appearance_expand_layer_display = m_paneLayerDisplayOptions->IsExpanded();
aCfg->m_AuiPanels.appearance_expand_net_display = m_paneNetDisplayOptions->IsExpanded();
}
void APPEARANCE_CONTROLS::createControls()
{
int hotkey;

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2020 Jon Evans <jon@craftyjon.com>
* Copyright (C) 2020-2022 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2020-2023 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software: you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the
@ -34,6 +34,7 @@ class BITMAP_TOGGLE;
class COLOR_SWATCH;
class INDICATOR_ICON;
class PCB_BASE_FRAME;
class PCBNEW_SETTINGS;
class ROW_ICON_PROVIDER;
class GRID_BITMAP_TOGGLE_RENDERER;
class WX_COLLAPSIBLE_PANE;
@ -199,6 +200,8 @@ public:
wxSize GetBestSize() const;
void SaveSettings( PCBNEW_SETTINGS* aCfg );
void OnLanguageChanged();
///< Update the panel contents from the application and board models.