Correctly de-highlight found items when closing Find dialog.

Fixes https://gitlab.com/kicad/code/kicad/issues/5775
This commit is contained in:
Jeff Young 2020-09-24 18:46:01 +01:00
parent f0739315f6
commit eaf151075c
2 changed files with 19 additions and 6 deletions

View File

@ -96,9 +96,6 @@ void DIALOG_SCH_FIND::OnClose( wxCloseEvent& aEvent )
{
// Notify the SCH_EDIT_FRAME
m_frame->OnFindDialogClose();
// Notify the controller
m_findDirty = true;
}
@ -279,6 +276,20 @@ void DIALOG_SCH_FIND::OnReplace( wxCommandEvent& aEvent )
wxArrayString DIALOG_SCH_FIND::GetFindEntries() const
{
int index = m_comboFind->FindString( m_comboFind->GetValue(), true );
if( index == wxNOT_FOUND )
{
m_comboFind->Insert( m_comboFind->GetValue(), 0 );
}
else if( index != 0 )
{
/* Move the search string to the top of the list if it isn't already there. */
wxString tmp = m_comboFind->GetValue();
m_comboFind->Delete( index );
m_comboFind->Insert( tmp, 0 );
}
return m_comboFind->GetStrings();
}

View File

@ -824,6 +824,8 @@ void SCH_EDIT_FRAME::OnFindDialogClose()
m_findReplaceDialog->Destroy();
m_findReplaceDialog = nullptr;
m_toolManager->RunAction( ACTIONS::updateFind, true );
}