Don't filter FocusIn events into the global search text box (doing so causes all kinds of unusual behaviour), instead just show the popup when pressing up or down.

This commit is contained in:
David Sansome 2011-11-08 22:38:57 +00:00
parent c1230f7b0a
commit 62383d02fc
2 changed files with 14 additions and 12 deletions

View File

@ -359,21 +359,23 @@ bool GlobalSearchWidget::EventFilterSearchWidget(QObject* o, QEvent* e) {
return true;
break;
case QEvent::FocusIn: {
QFocusEvent* fe = static_cast<QFocusEvent*>(e);
switch (fe->reason()) {
case Qt::MouseFocusReason:
case Qt::TabFocusReason:
case Qt::BacktabFocusReason:
if (!ui_->search->text().isEmpty())
RepositionPopup();
break;
case QEvent::KeyPress: {
QKeyEvent* ke = static_cast<QKeyEvent*>(e);
const int key = ke->key();
switch (key) {
case Qt::Key_Up:
case Qt::Key_Down:
case Qt::Key_PageUp:
case Qt::Key_PageDown:
// If we got one of these it means the popup wasn't visible, so show it
// now.
RepositionPopup();
return true;
default:
break;
}
break;
}
default:

View File

@ -4542,7 +4542,7 @@ msgstr ""
msgid "does not contain"
msgstr ""
#: globalsearch/globalsearchwidget.cpp:729
#: globalsearch/globalsearchwidget.cpp:731
msgid "e.g."
msgstr ""