mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-22 21:21:32 +00:00
Advanced F&R: Improve code on Return key
This commit is contained in:
parent
a2a5656d07
commit
50783d94a8
@ -102,17 +102,13 @@ bool FindAndReplaceWidget::eventFilter(QObject * obj, QEvent * event)
|
|||||||
|
|
||||||
case Qt::Key_Enter:
|
case Qt::Key_Enter:
|
||||||
case Qt::Key_Return: {
|
case Qt::Key_Return: {
|
||||||
// with shift we (temporarily) change search/replace direction
|
bool const searchback = (e->modifiers() == Qt::ShiftModifier);
|
||||||
bool const searchback = searchbackCB->isChecked();
|
bool const replace = (obj == replace_work_area_);
|
||||||
if (e->modifiers() == Qt::ShiftModifier && !searchback)
|
findAndReplace(searchback, replace);
|
||||||
searchbackCB->setChecked(true);
|
if (replace)
|
||||||
|
replace_work_area_->setFocus();
|
||||||
if (obj == find_work_area_)
|
|
||||||
on_findNextPB_clicked();
|
|
||||||
else
|
else
|
||||||
on_replacePB_clicked();
|
find_work_area_->setFocus();
|
||||||
// back to how it was
|
|
||||||
searchbackCB->setChecked(searchback);
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user