diff --git a/src/librssguard/services/gmail/gui/emailrecipientcontrol.cpp b/src/librssguard/services/gmail/gui/emailrecipientcontrol.cpp index 026f7b25a..67efafd68 100644 --- a/src/librssguard/services/gmail/gui/emailrecipientcontrol.cpp +++ b/src/librssguard/services/gmail/gui/emailrecipientcontrol.cpp @@ -23,9 +23,12 @@ EmailRecipientControl::EmailRecipientControl(const QString& recipient, QWidget* m_cmbRecipientType->setFocusPolicy(Qt::FocusPolicy::NoFocus); m_btnCloseMe->setFocusPolicy(Qt::FocusPolicy::NoFocus); + m_txtRecipient->setFocusPolicy(Qt::FocusPolicy::StrongFocus); m_txtRecipient->setPlaceholderText(tr("E-mail address")); m_txtRecipient->setText(recipient); + setFocusProxy(m_txtRecipient); + m_btnCloseMe->setToolTip("Remove this recipient."); m_btnCloseMe->setIcon(qApp->icons()->fromTheme(QSL("list-remove"))); diff --git a/src/librssguard/services/gmail/gui/formaddeditemail.cpp b/src/librssguard/services/gmail/gui/formaddeditemail.cpp index 58519bd6a..0d71096d7 100644 --- a/src/librssguard/services/gmail/gui/formaddeditemail.cpp +++ b/src/librssguard/services/gmail/gui/formaddeditemail.cpp @@ -49,7 +49,7 @@ FormAddEditEmail::FormAddEditEmail(GmailServiceRoot* root, QWidget* parent) } void FormAddEditEmail::execForAdd() { - addRecipientRow(); + addRecipientRow()->setFocus(); exec(); } @@ -58,6 +58,7 @@ void FormAddEditEmail::execForReply(Message* original_message) { addRecipientRow(m_originalMessage->m_author); m_ui.m_txtSubject->setText(QSL("Re: %1").arg(m_originalMessage->m_title)); + m_ui.m_txtMessage->setFocus(); exec(); } @@ -137,13 +138,15 @@ void FormAddEditEmail::onOkClicked() { } } -void FormAddEditEmail::addRecipientRow(const QString& recipient) { +EmailRecipientControl* FormAddEditEmail::addRecipientRow(const QString& recipient) { auto* mail_rec = new EmailRecipientControl(recipient, this); connect(mail_rec, &EmailRecipientControl::removalRequested, this, &FormAddEditEmail::removeRecipientRow); mail_rec->setPossibleRecipients(m_possibleRecipients); m_ui.m_layout->insertRow(m_ui.m_layout->count() - 5, mail_rec); + + return mail_rec; } QList FormAddEditEmail::recipientControls() const { diff --git a/src/librssguard/services/gmail/gui/formaddeditemail.h b/src/librssguard/services/gmail/gui/formaddeditemail.h index a1985d9e8..7c45dfb1b 100644 --- a/src/librssguard/services/gmail/gui/formaddeditemail.h +++ b/src/librssguard/services/gmail/gui/formaddeditemail.h @@ -28,7 +28,7 @@ class FormAddEditEmail : public QDialog { private slots: void removeRecipientRow(); void onOkClicked(); - void addRecipientRow(const QString& recipient = QString()); + EmailRecipientControl* addRecipientRow(const QString& recipient = QString()); private: QList recipientControls() const;