7
mirror of https://gitlab.com/kicad/code/kicad.git synced 2025-04-20 20:11:41 +00:00

Don't use size events for persistence

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20060
This commit is contained in:
Jon Evans 2025-03-11 22:36:46 -04:00
parent 5774338af2
commit 95e6ca44c6
4 changed files with 10 additions and 6 deletions

View File

@ -105,11 +105,14 @@ SEARCH_PANE::SEARCH_PANE( EDA_DRAW_FRAME* aFrame ) :
{
PopupMenu( m_menu );
} );
m_frame->Bind( wxEVT_AUI_PANE_CLOSE, &SEARCH_PANE::OnClosed, this );
}
SEARCH_PANE::~SEARCH_PANE()
{
m_frame->Unbind( wxEVT_AUI_PANE_CLOSE, &SEARCH_PANE::OnClosed, this );
m_frame->Unbind( EDA_LANG_CHANGED, &SEARCH_PANE::OnLanguageChange, this );
delete m_menu;
@ -185,7 +188,7 @@ void SEARCH_PANE::OnNotebookPageChanged( wxBookCtrlEvent& aEvent )
}
void SEARCH_PANE::OnSize( wxSizeEvent& aEvent )
void SEARCH_PANE::OnClosed( wxAuiManagerEvent& aEvent )
{
if( APP_SETTINGS_BASE* cfg = m_frame->config() )
m_frame->SaveSettings( cfg );

View File

@ -85,18 +85,19 @@ DESIGN_BLOCK_PANE::DESIGN_BLOCK_PANE( SCH_EDIT_FRAME* aParent, const LIB_ID* aPr
Layout();
Bind( wxEVT_CHAR_HOOK, &PANEL_DESIGN_BLOCK_CHOOSER::OnChar, m_chooserPanel );
Bind( wxEVT_SIZE, &DESIGN_BLOCK_PANE::OnSize, this );
m_frame->Bind( EDA_LANG_CHANGED, &DESIGN_BLOCK_PANE::OnLanguageChanged, this );
m_frame->Bind( wxEVT_AUI_PANE_CLOSE, &DESIGN_BLOCK_PANE::OnClosed, this );
}
DESIGN_BLOCK_PANE::~DESIGN_BLOCK_PANE()
{
m_frame->Unbind( wxEVT_AUI_PANE_CLOSE, &DESIGN_BLOCK_PANE::OnClosed, this );
m_frame->Unbind( EDA_LANG_CHANGED, &DESIGN_BLOCK_PANE::OnLanguageChanged, this );
}
void DESIGN_BLOCK_PANE::OnSize( wxSizeEvent &aEvent )
void DESIGN_BLOCK_PANE::OnClosed( wxAuiManagerEvent &aEvent )
{
if( APP_SETTINGS_BASE* cfg = m_frame->config() )
{

View File

@ -80,14 +80,13 @@ public:
void OnDeleteLibrary( wxCommandEvent& aEvent );
void OnDeleteDesignBlock( wxCommandEvent& aEvent );
void OnSize( wxSizeEvent& aEvent );
PANEL_DESIGN_BLOCK_CHOOSER* GetDesignBlockPanel() const { return m_chooserPanel; }
protected:
void setLabelsAndTooltips();
virtual void OnLanguageChanged( wxCommandEvent& aEvent );
void OnClosed( wxAuiManagerEvent& aEvent );
protected:
PANEL_DESIGN_BLOCK_CHOOSER* m_chooserPanel;

View File

@ -27,6 +27,7 @@
#include <wx/listbase.h>
class wxAuiManagerEvent;
class ACTION_MENU;
class EDA_DRAW_FRAME;
class SEARCH_PANE_TAB;
@ -70,7 +71,6 @@ public:
void AddSearcher( SEARCH_HANDLER* aHandler );
void OnSearchTextEntry( wxCommandEvent& aEvent ) override;
void OnNotebookPageChanged( wxBookCtrlEvent& aEvent ) override;
void OnSize( wxSizeEvent& aEvent ) override;
void RefreshSearch();
void FocusSearch();
@ -79,6 +79,7 @@ public:
protected:
void OnLanguageChange( wxCommandEvent& aEvent );
SEARCH_PANE_TAB* GetCurrentTab() const;
void OnClosed( wxAuiManagerEvent& aEvent );
private:
std::vector<SEARCH_HANDLER*> m_handlers;