Skip to content

Commit

Permalink
Return keyboard focus after saving database edits (#4287)
Browse files Browse the repository at this point in the history
  • Loading branch information
Sigmaupsilon authored and phoerious committed Apr 9, 2020
1 parent e9754ef commit 3552ba2
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/gui/DatabaseWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1646,6 +1646,8 @@ bool DatabaseWidget::save()
m_blockAutoSave = true;
++m_saveAttempts;

auto focusWidget = qApp->focusWidget();

// TODO: Make this async
// Lock out interactions
m_entryView->setDisabled(true);
Expand All @@ -1660,6 +1662,10 @@ bool DatabaseWidget::save()
m_entryView->setDisabled(false);
m_groupView->setDisabled(false);

if (focusWidget) {
focusWidget->setFocus();
}

if (ok) {
m_saveAttempts = 0;
m_blockAutoSave = false;
Expand Down

0 comments on commit 3552ba2

Please sign in to comment.