From 6543c88d5c4c5c0685a3103d60fefda50cbc2a4c Mon Sep 17 00:00:00 2001 From: Xiao Yi Fang Date: Thu, 18 Jul 2024 11:11:35 +0800 Subject: [PATCH] opt: remove the existed highlight when no match --- src/ui/articleview.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index 324f70f01..4e60257c3 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -1965,8 +1965,6 @@ void ArticleView::on_searchCloseButton_clicked() void ArticleView::on_searchCaseSensitive_clicked() { - // clear the previous findText results - webview->findText( "" ); performFindOperation( false ); } @@ -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 ); } ); }