Make Ctrl+F not toggle the search mode but always enable it.

Switching back from other applications, the previous behavior of Ctrl+F
would often bother you in that it would dismiss the search widget if it
was already enabled when you meant by the key you wanted to perform a
search.

Making Ctrl+F always set you in search mode should save user from having
to care about the mode which is persistent across application switching
and database locking.
This commit is contained in:
Akinori MUSHA 2014-11-18 16:26:04 +09:00
parent 57107ea560
commit b1c3814972
5 changed files with 56 additions and 16 deletions

View file

@ -702,6 +702,22 @@ void DatabaseWidget::switchToImportKeepass1(const QString& fileName)
setCurrentWidget(m_keepass1OpenWidget);
}
void DatabaseWidget::openSearch()
{
if (isInSearchMode()) {
m_searchUi->searchEdit->selectAll();
if (!m_searchUi->searchEdit->hasFocus()) {
m_searchUi->searchEdit->setFocus();
// make sure the search action is checked again
emitCurrentModeChanged();
}
}
else {
showSearch();
}
}
void DatabaseWidget::toggleSearch()
{
if (isInSearchMode()) {