From c5948de2aff66cac3cb6e1e9e08fce37dba74dbc Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 2 Jan 2023 18:43:35 +0000 Subject: [PATCH] Update find status when switching sheets. (Not just when switching sheet during find.) Fixes https://gitlab.com/kicad/code/kicad/issues/13351 --- eeschema/sch_edit_frame.cpp | 30 +++++++++++++++++++++++++++ eeschema/tools/sch_editor_control.cpp | 1 - 2 files changed, 30 insertions(+), 1 deletion(-) diff --git a/eeschema/sch_edit_frame.cpp b/eeschema/sch_edit_frame.cpp index 74ba8b4456..1656737beb 100644 --- a/eeschema/sch_edit_frame.cpp +++ b/eeschema/sch_edit_frame.cpp @@ -1851,6 +1851,36 @@ void SCH_EDIT_FRAME::DisplayCurrentSheet() GetCurrentSheet().UpdateAllScreenReferences(); SetSheetNumberAndCount(); + EE_SELECTION_TOOL* selectionTool = m_toolManager->GetTool(); + + 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(); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 2494368626..cff28a34a5 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -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; }