Properties: don't rebuild the panel when closing an editor
Fixes https://gitlab.com/kicad/code/kicad/-/issues/12984
This commit is contained in:
parent
c0ab2258a4
commit
5bbe21f540
|
@ -37,7 +37,8 @@ extern APIIMPORT wxPGGlobalVarsClass* wxPGGlobalVars;
|
|||
PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame ) :
|
||||
wxPanel( aParent ),
|
||||
m_frame( aFrame ),
|
||||
m_splitter_key_proportion( -1 )
|
||||
m_splitter_key_proportion( -1 ),
|
||||
m_skipNextUpdate( false )
|
||||
{
|
||||
wxBoxSizer* mainSizer = new wxBoxSizer( wxVERTICAL );
|
||||
|
||||
|
@ -88,6 +89,15 @@ PROPERTIES_PANEL::PROPERTIES_PANEL( wxWindow* aParent, EDA_BASE_FRAME* aFrame )
|
|||
|
||||
void PROPERTIES_PANEL::update( const SELECTION& aSelection )
|
||||
{
|
||||
if( m_skipNextUpdate )
|
||||
{
|
||||
m_skipNextUpdate = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if( m_grid->IsEditorFocused() )
|
||||
m_grid->CommitChangesFromEditor();
|
||||
|
||||
m_grid->Clear();
|
||||
m_displayed.clear();
|
||||
|
||||
|
|
|
@ -78,6 +78,9 @@ protected:
|
|||
|
||||
/// Proportion of the grid column splitter that is used for the key column (0.0 - 1.0)
|
||||
float m_splitter_key_proportion;
|
||||
|
||||
/// Skips one call to update()
|
||||
bool m_skipNextUpdate;
|
||||
};
|
||||
|
||||
#endif /* PROPERTIES_PANEL_H */
|
||||
|
|
|
@ -115,6 +115,9 @@ void PCB_PROPERTIES_PANEL::valueChanged( wxPropertyGridEvent& aEvent )
|
|||
item->Set( property, newValue );
|
||||
}
|
||||
|
||||
// Pushing the commit will result in a SelectedItemsModified event, which we want to skip
|
||||
m_skipNextUpdate = true;
|
||||
|
||||
changes.Push( _( "Change property" ) );
|
||||
m_frame->Refresh();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue