Adv F&R: indicate search direction

This commit is contained in:
Juergen Spitzmueller 2021-02-17 09:50:18 +01:00
parent 5ed0dddcf2
commit a2a5656d07
2 changed files with 25 additions and 0 deletions

View File

@ -530,6 +530,12 @@ void FindAndReplaceWidget::on_replaceallPB_clicked()
} }
void FindAndReplaceWidget::on_searchbackCB_clicked()
{
updateButtons();
}
// Copy selected elements from bv's BufferParams to the dest_bv's // Copy selected elements from bv's BufferParams to the dest_bv's
static void copy_params(BufferView const & bv, BufferView & dest_bv) { static void copy_params(BufferView const & bv, BufferView & dest_bv) {
Buffer const & doc_buf = bv.buffer(); Buffer const & doc_buf = bv.buffer();
@ -577,6 +583,7 @@ bool FindAndReplaceWidget::initialiseParams(std::string const & /*params*/)
void FindAndReplace::updateView() void FindAndReplace::updateView()
{ {
widget_->updateGUI(); widget_->updateGUI();
widget_->updateButtons();
} }
@ -633,6 +640,22 @@ void FindAndReplaceWidget::updateGUI()
} }
void FindAndReplaceWidget::updateButtons()
{
if (searchbackCB->isChecked()) {
findNextPB->setText(qt_("&< Find"));
findNextPB->setToolTip(qt_("Find previous occurrence (Shift+Enter, forwards: Enter)"));
replacePB->setText(qt_("< Rep&lace"));
replacePB->setToolTip(qt_("Replace and find previous occurrence (Shift+Enter, forwards: Enter)"));
} else {
findNextPB->setText(qt_("Find &>"));
findNextPB->setToolTip(qt_("Find next occurrence (Enter, backwards: Shift+Enter)"));
replacePB->setText(qt_("Rep&lace >"));
replacePB->setToolTip(qt_("Replace and find next occurrence (Enter, backwards: Shift+Enter)"));
}
}
} // namespace frontend } // namespace frontend
} // namespace lyx } // namespace lyx

View File

@ -33,6 +33,7 @@ public:
FindAndReplaceWidget(GuiView & view); FindAndReplaceWidget(GuiView & view);
bool initialiseParams(std::string const & params); bool initialiseParams(std::string const & params);
void updateGUI(); void updateGUI();
void updateButtons();
public Q_SLOTS: public Q_SLOTS:
/// ///
@ -69,6 +70,7 @@ protected Q_SLOTS:
void on_findNextPB_clicked(); void on_findNextPB_clicked();
void on_replacePB_clicked(); void on_replacePB_clicked();
void on_replaceallPB_clicked(); void on_replaceallPB_clicked();
void on_searchbackCB_clicked();
}; };