From 5d4fba7c51bbf152057fe03cf4bd36877556759f Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Mon, 28 Feb 2022 19:49:58 +0100 Subject: [PATCH] Ctrl+F always enters find edit box in macro editor, not only if something is selected. --- src/lay/lay/layMacroEditorDialog.cc | 6 +++++- src/lay/lay/layMacroEditorPage.cc | 4 ++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/lay/lay/layMacroEditorDialog.cc b/src/lay/lay/layMacroEditorDialog.cc index 49da27914..90a0b1f27 100644 --- a/src/lay/lay/layMacroEditorDialog.cc +++ b/src/lay/lay/layMacroEditorDialog.cc @@ -1978,7 +1978,11 @@ MacroEditorDialog::replace_all_button_clicked () void MacroEditorDialog::search_requested (const QString &s) { - searchEditBox->setText (s); + if (! s.isNull ()) { + searchEditBox->setText (s); + } else { + searchEditBox->selectAll (); + } searchEditBox->setFocus (); search_editing (); } diff --git a/src/lay/lay/layMacroEditorPage.cc b/src/lay/lay/layMacroEditorPage.cc index 8983724ce..d5929a4bb 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -1788,7 +1788,11 @@ MacroEditorPage::eventFilter (QObject *watched, QEvent *event) QTextBlock e = mp_text->document ()->findBlock (c.selectionEnd ()); if (e == s) { emit search_requested (c.selectedText ()); + } else { + emit search_requested (QString ()); } + } else { + emit search_requested (QString ()); } return true;