ui: Refocus already focused search box on find shortcut to select content

This commit is contained in:
Eberhard Graether
2019-05-20 11:43:28 +02:00
parent bcef315789
commit a526612fdb
+5 -5
View File
@@ -162,6 +162,11 @@ void QtSmartSearchBox::setMatches(const std::vector<SearchMatch>& matches)
void QtSmartSearchBox::setFocus()
{
if (hasFocus())
{
clearFocus();
}
QLineEdit::setFocus(Qt::ShortcutFocusReason);
}
@@ -659,11 +664,6 @@ void QtSmartSearchBox::onElementSelected(QtSearchElement* element)
return;
}
if (!hasFocus())
{
setFocus();
}
if (!hasSelectedElements() && !m_shiftKeyDown)
{
editElement(element);