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