From ef321e5fcd3232d4fb31aafcf062fdefc1d0e35f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Mon, 14 Aug 2023 19:10:16 +0100 Subject: [PATCH] Un-brighten found text when making a new selection. Fixes https://gitlab.com/kicad/code/kicad/-/issues/15092 --- eeschema/tools/sch_find_replace_tool.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/eeschema/tools/sch_find_replace_tool.cpp b/eeschema/tools/sch_find_replace_tool.cpp index 3859560988..16c4b0fc46 100644 --- a/eeschema/tools/sch_find_replace_tool.cpp +++ b/eeschema/tools/sch_find_replace_tool.cpp @@ -95,11 +95,18 @@ int SCH_FIND_REPLACE_TOOL::UpdateFind( const TOOL_EVENT& aEvent ) || aEvent.Matches( EVENTS::UnselectedEvent ) || aEvent.Matches( EVENTS::ClearedEvent ) ) { - // Normal find modifies the selection, but selection-based find does - // not so we want to start over in the items we are searching through when - // the selection changes - if( selectedOnly ) + if( !m_frame->m_findReplaceDialog ) { + if( m_foundItemHighlighted ) + { + m_foundItemHighlighted = false; + visitAll(); + } + } + else if( selectedOnly ) + { + // Normal find modifies the selection, but selection-based find does not, so we want + // to start over in the items we are searching through when the selection changes m_afterItem = nullptr; visitAll(); } @@ -239,8 +246,10 @@ int SCH_FIND_REPLACE_TOOL::FindNext( const TOOL_EVENT& aEvent ) } if( afterSheet || !searchAllSheets ) + { item = nextMatch( m_frame->GetScreen(), &m_frame->GetCurrentSheet(), m_afterItem, data, isReversed ); + } if( !item && searchAllSheets ) {