From 180fca2fcdcad4031959e76f738eeae13e5ba398 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Wed, 17 Feb 2021 14:32:26 +0100 Subject: [PATCH] Fix Find button with search as you type --- src/frontends/qt/GuiSearch.cpp | 8 ++++---- src/frontends/qt/GuiSearch.h | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/frontends/qt/GuiSearch.cpp b/src/frontends/qt/GuiSearch.cpp index 01f3ec89f9..fcb8c85e53 100644 --- a/src/frontends/qt/GuiSearch.cpp +++ b/src/frontends/qt/GuiSearch.cpp @@ -193,17 +193,17 @@ void GuiSearchWidget::findChanged() replacePrevPB->setEnabled(replace); replaceallPB->setEnabled(replace); if (instantSearchCB->isChecked() && !emptytext) - findClicked(); + findClicked(false, true); } -void GuiSearchWidget::findClicked(bool const backwards) +void GuiSearchWidget::findClicked(bool const backwards, bool const instant) { docstring const needle = qstring_to_ucs4(findCO->currentText()); find(needle, caseCB->isChecked(), wordsCB->isChecked(), !backwards, - instantSearchCB->isChecked(), wrapCB->isChecked(), selectionCB->isChecked()); + instant, wrapCB->isChecked(), selectionCB->isChecked()); uniqueInsert(findCO, findCO->currentText()); - if (!instantSearchCB->isChecked()) + if (!instant) findCO->lineEdit()->selectAll(); } diff --git a/src/frontends/qt/GuiSearch.h b/src/frontends/qt/GuiSearch.h index d3574b3363..6e05f49754 100644 --- a/src/frontends/qt/GuiSearch.h +++ b/src/frontends/qt/GuiSearch.h @@ -45,7 +45,8 @@ public: private Q_SLOTS: void findChanged(); void findBufferChanged(); - void findClicked(bool const backwards = false); + void findClicked(bool const backwards = false, + bool const instant = false); void findPrevClicked(); void replaceClicked(bool const backwards = false); void replacePrevClicked(); -- 2.39.5