Merge pull request #887 from Noettore/hotfix/847-search_focus_at_startup

Solve issue #847: Keyboard autofocus on search field at startup
This commit is contained in:
Janek Bevendorff 2017-08-28 14:32:56 +02:00 committed by GitHub
commit e72c56520e
2 changed files with 3 additions and 1 deletions

View File

@ -464,6 +464,7 @@ void MainWindow::setMenuActionState(DatabaseWidget::Mode mode)
m_ui->actionDatabaseMerge->setEnabled(m_ui->tabWidget->currentIndex() != -1);
m_searchWidgetAction->setEnabled(true);
break;
}
case DatabaseWidget::EditMode:

View File

@ -119,7 +119,8 @@ void SearchWidget::databaseChanged(DatabaseWidget* dbWidget)
if (dbWidget != nullptr) {
// Set current search text from this database
m_ui->searchEdit->setText(dbWidget->getCurrentSearch());
// Keyboard focus on search widget at database unlocking
connect(dbWidget, SIGNAL(unlockedDatabase()), this, SLOT(searchFocus()));
// Enforce search policy
emit caseSensitiveChanged(m_actionCaseSensitive->isChecked());
emit limitGroupChanged(m_actionLimitGroup->isChecked());