diff --git a/src/ui/articleview.cc b/src/ui/articleview.cc index 3c6d306a..d66ab839 100644 --- a/src/ui/articleview.cc +++ b/src/ui/articleview.cc @@ -137,7 +137,7 @@ ArticleView::ArticleView( QWidget * parent, connect( searchPanel->previous, &QPushButton::clicked, this, &ArticleView::on_searchPrevious_clicked ); connect( searchPanel->next, &QPushButton::clicked, this, &ArticleView::on_searchNext_clicked ); connect( searchPanel->close, &QPushButton::clicked, this, &ArticleView::on_searchCloseButton_clicked ); - connect( searchPanel->caseSensitive, &QPushButton::clicked, this, &ArticleView::on_searchCaseSensitive_clicked ); + connect( searchPanel->caseSensitive, &QCheckBox::toggled, this, &ArticleView::on_searchCaseSensitive_clicked ); connect( searchPanel->lineEdit, &QLineEdit::textEdited, this, &ArticleView::on_searchText_textEdited ); connect( searchPanel->lineEdit, &QLineEdit::returnPressed, this, &ArticleView::on_searchText_returnPressed ); connect( ftsSearchPanel->next, &QPushButton::clicked, this, &ArticleView::on_ftsSearchNext_clicked ); @@ -1963,8 +1963,11 @@ void ArticleView::on_searchCloseButton_clicked() closeSearch(); } -void ArticleView::on_searchCaseSensitive_clicked() +void ArticleView::on_searchCaseSensitive_clicked( bool checked ) { + //clear the previous findText results. + //when the results is empty, the highlight has not been removed.more likely a qt bug. + webview->findText( "" ); performFindOperation( false ); } @@ -2027,11 +2030,6 @@ void ArticleView::performFindOperation( bool backwards ) findText( text, f, [ text, this ]( bool match ) { 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 ); } ); } diff --git a/src/ui/articleview.hh b/src/ui/articleview.hh index 36b6b20b..2aa82f8f 100644 --- a/src/ui/articleview.hh +++ b/src/ui/articleview.hh @@ -357,7 +357,7 @@ private slots: void on_searchText_textEdited(); void on_searchText_returnPressed(); void on_searchCloseButton_clicked(); - void on_searchCaseSensitive_clicked(); + void on_searchCaseSensitive_clicked( bool ); void on_ftsSearchPrevious_clicked(); void on_ftsSearchNext_clicked();