Update find status when switching sheets.

(Not just when switching sheet during find.)

Fixes https://gitlab.com/kicad/code/kicad/issues/13351
This commit is contained in:
Jeff Young 2023-01-02 18:43:35 +00:00
parent 5067e82e06
commit c5948de2af
2 changed files with 30 additions and 1 deletions

View File

@ -1851,6 +1851,36 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet()
GetCurrentSheet().UpdateAllScreenReferences();
SetSheetNumberAndCount();
EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool<EE_SELECTION_TOOL>();
auto visit =
[&]( EDA_ITEM* item )
{
if( m_findReplaceDialog
&& !m_findReplaceData->findString.IsEmpty()
&& item->Matches( *m_findReplaceData, &GetCurrentSheet() ) )
{
item->SetForceVisible( true );
selectionTool->BrightenItem( item );
}
else if( item->IsBrightened() )
{
item->SetForceVisible( false );
selectionTool->UnbrightenItem( item );
}
};
for( SCH_ITEM* item : screen->Items() )
{
visit( item );
item->RunOnChildren(
[&]( SCH_ITEM* aChild )
{
visit( aChild );
} );
}
if( !screen->m_zoomInitialized )
{
initScreenZoom();

View File

@ -542,7 +542,6 @@ int SCH_EDITOR_CONTROL::FindNext( const TOOL_EVENT& aEvent )
{
m_frame->Schematic().SetCurrentSheet( *sheet );
m_frame->DisplayCurrentSheet();
UpdateFind( ACTIONS::updateFind.MakeEvent() );
break;
}