mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-23 20:14:05 +00:00
opt: findtext casesensitivity (#1698)
* opt: reset the selection results * opt: remove the existed highlight when no match * [autofix.ci] apply automated fixes * opt: remove the existed highlight when no match * opt: remove the existed highlight when no match * opt: code minor optimization --------- Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
This commit is contained in:
parent
5164ffba67
commit
06d4b62b67
|
@ -2026,8 +2026,13 @@ void ArticleView::performFindOperation( bool backwards )
|
|||
f |= QWebEnginePage::FindBackward;
|
||||
|
||||
findText( text, f, [ text, this ]( bool match ) {
|
||||
bool setMark = !text.isEmpty() && !match;
|
||||
Utils::Widget::setNoResultColor( searchPanel->lineEdit, setMark );
|
||||
bool nomatch = !text.isEmpty() && !match;
|
||||
if ( nomatch ) {
|
||||
//clear the previous findText results.
|
||||
//when the results is empty, the highlight has not been removed.more likely a qt bug.
|
||||
webview->findText( "" );
|
||||
}
|
||||
Utils::Widget::setNoResultColor( searchPanel->lineEdit, nomatch );
|
||||
} );
|
||||
}
|
||||
|
||||
|
@ -2065,10 +2070,7 @@ bool ArticleView::closeSearch()
|
|||
ftsSearchPanel->hide();
|
||||
webview->setFocus();
|
||||
|
||||
QWebEnginePage::FindFlags flags( 0 );
|
||||
|
||||
webview->findText( "", flags );
|
||||
|
||||
webview->findText( "" );
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
Loading…
Reference in a new issue