Ctrl+F always enters find edit box in macro editor, not only if something is selected.

This commit is contained in:
Matthias Koefferlein 2022-02-28 19:49:58 +01:00
parent 1f02c2b9e9
commit 5d4fba7c51
2 changed files with 9 additions and 1 deletions

View File

@ -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 ();
}

View File

@ -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;