Focus the search field instead of closing it when pressing the shortcut.

Closes #124
This commit is contained in:
Felix Geyer 2014-05-16 12:33:29 +02:00
parent a6d44034a4
commit 2d8ba2b394

View File

@ -681,8 +681,16 @@ void DatabaseWidget::switchToImportKeepass1(const QString& fileName)
void DatabaseWidget::toggleSearch()
{
if (m_entryView->inEntryListMode()) {
closeSearch();
if (isInSearchMode()) {
if (m_searchUi->searchEdit->hasFocus()) {
closeSearch();
}
else {
m_searchUi->searchEdit->selectAll();
m_searchUi->searchEdit->setFocus();
// make sure the search action is checked again
emitCurrentModeChanged();
}
}
else {
showSearch();