Keep state except when the filter changed.
(Used to be "except when filtering".) Fixes: lp:1804293 * https://bugs.launchpad.net/kicad/+bug/1804293
This commit is contained in:
parent
ff668968f3
commit
d2756bedf1
|
@ -182,12 +182,12 @@ void LIB_TREE::ExpandLibId( const LIB_ID& aLibId )
|
|||
}
|
||||
|
||||
|
||||
void LIB_TREE::Regenerate()
|
||||
void LIB_TREE::Regenerate( bool aKeepState )
|
||||
{
|
||||
STATE current;
|
||||
|
||||
// Store the state
|
||||
if( !m_filtering )
|
||||
if( aKeepState )
|
||||
m_unfilteredState = getState();
|
||||
|
||||
wxString filter = m_query_ctrl->GetValue();
|
||||
|
@ -196,7 +196,7 @@ void LIB_TREE::Regenerate()
|
|||
postPreselectEvent();
|
||||
|
||||
// Restore the state
|
||||
if( !m_filtering )
|
||||
if( aKeepState )
|
||||
setState( m_unfilteredState );
|
||||
}
|
||||
|
||||
|
@ -297,7 +297,7 @@ void LIB_TREE::setState( const STATE& aState )
|
|||
|
||||
void LIB_TREE::onQueryText( wxCommandEvent& aEvent )
|
||||
{
|
||||
Regenerate();
|
||||
Regenerate( false );
|
||||
|
||||
// Required to avoid interaction with SetHint()
|
||||
// See documentation for wxTextEntry::SetHint
|
||||
|
|
|
@ -111,7 +111,7 @@ public:
|
|||
/**
|
||||
* Regenerates the tree.
|
||||
*/
|
||||
void Regenerate();
|
||||
void Regenerate( bool aKeepState );
|
||||
|
||||
void SetFocus() override;
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ SYMBOL_TREE_PANE::~SYMBOL_TREE_PANE()
|
|||
void SYMBOL_TREE_PANE::Regenerate()
|
||||
{
|
||||
if( m_tree )
|
||||
m_tree->Regenerate();
|
||||
m_tree->Regenerate( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -122,7 +122,7 @@ FOOTPRINT_TREE_PANE::~FOOTPRINT_TREE_PANE()
|
|||
void FOOTPRINT_TREE_PANE::Regenerate()
|
||||
{
|
||||
if( m_tree )
|
||||
m_tree->Regenerate();
|
||||
m_tree->Regenerate( true );
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue