Skip to content

Commit

Permalink
opt: remove the existed highlight when no match
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Jul 18, 2024
1 parent 258d001 commit 6543c88
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ui/articleview.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1965,8 +1965,6 @@ void ArticleView::on_searchCloseButton_clicked()

void ArticleView::on_searchCaseSensitive_clicked()
{
// clear the previous findText results
webview->findText( "" );
performFindOperation( false );
}

Expand Down Expand Up @@ -2029,6 +2027,11 @@ void ArticleView::performFindOperation( bool backwards )

findText( text, f, [ text, this ]( bool match ) {
bool setMark = !text.isEmpty() && !match;
if(setMark){
//clear the previous findText results.
//when the results is empty, the highlight has not been removed.more likely a qt bug.
findText( "" );
}
Utils::Widget::setNoResultColor( searchPanel->lineEdit, setMark );
} );
}
Expand Down

0 comments on commit 6543c88

Please sign in to comment.