Return keyboard focus after saving database edits (#4287)

This commit is contained in:
Ojas Anand 2020-02-27 21:21:27 -05:00 committed by GitHub
parent 409190c85a
commit b188385184
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1657,6 +1657,8 @@ bool DatabaseWidget::save()
m_blockAutoSave = true;
++m_saveAttempts;
auto focusWidget = qApp->focusWidget();
// TODO: Make this async
// Lock out interactions
m_entryView->setDisabled(true);
@ -1671,6 +1673,10 @@ bool DatabaseWidget::save()
m_entryView->setDisabled(false);
m_groupView->setDisabled(false);
if (focusWidget) {
focusWidget->setFocus();
}
if (ok) {
m_saveAttempts = 0;
m_blockAutoSave = false;