From f5dfe8a5e78deeb978c5b2ed6c6dbcb63568e72b 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 d075c6a25..d82fe8331 100644 --- a/src/lay/lay/layMacroEditorDialog.cc +++ b/src/lay/lay/layMacroEditorDialog.cc @@ -1970,7 +1970,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 b2beca306..8942c17f1 100644 --- a/src/lay/lay/layMacroEditorPage.cc +++ b/src/lay/lay/layMacroEditorPage.cc @@ -1770,7 +1770,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;