From e2aacd23615f470f43ed667c5af7d449b237bef7 Mon Sep 17 00:00:00 2001 From: Roy Qu Date: Fri, 5 Apr 2024 12:24:24 +0800 Subject: [PATCH] After search dialog is openned, auto set focus to the control for keyword. --- RedPandaIDE/widgets/searchdialog.cpp | 6 +++--- RedPandaIDE/widgets/searchinfiledialog.cpp | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/RedPandaIDE/widgets/searchdialog.cpp b/RedPandaIDE/widgets/searchdialog.cpp index 73ffeca0..698b4b65 100644 --- a/RedPandaIDE/widgets/searchdialog.cpp +++ b/RedPandaIDE/widgets/searchdialog.cpp @@ -43,7 +43,7 @@ void SearchDialog::find(const QString &text) { mTabBar->setCurrentIndex(mSearchTabIdx); ui->cbFind->setCurrentText(text); - ui->btnNext->setFocus(); + ui->cbFind->setFocus(); show(); } @@ -51,8 +51,8 @@ void SearchDialog::replace(const QString &text) { mTabBar->setCurrentIndex(mReplaceTabIdx); ui->cbFind->setCurrentText(text); - ui->btnNext->setFocus(); - //ui->cbReplace->setCurrentText(""); + ui->cbReplace->setCurrentText(text); + ui->cbFind->setFocus(); show(); } diff --git a/RedPandaIDE/widgets/searchinfiledialog.cpp b/RedPandaIDE/widgets/searchinfiledialog.cpp index 3c0cac9c..4fa7df66 100644 --- a/RedPandaIDE/widgets/searchinfiledialog.cpp +++ b/RedPandaIDE/widgets/searchinfiledialog.cpp @@ -55,7 +55,7 @@ SearchInFileDialog::~SearchInFileDialog() void SearchInFileDialog::findInFiles(const QString &text) { ui->cbFind->setCurrentText(text); - ui->btnExecute->setFocus(); + ui->cbFind->setFocus(); show(); }