X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/4e82b359897def33c90cd5465cda3ed10b5aa01a..b60da9b67acbfe94e43bd631e4e685f366d53ec5:/src/dolphinviewautoscroller.cpp diff --git a/src/dolphinviewautoscroller.cpp b/src/dolphinviewautoscroller.cpp index 67bc696cc..fbce803b8 100644 --- a/src/dolphinviewautoscroller.cpp +++ b/src/dolphinviewautoscroller.cpp @@ -85,11 +85,19 @@ bool DolphinViewAutoScroller::eventFilter(QObject* watched, QEvent* event) break; } } else if ((watched == m_itemView) && (event->type() == QEvent::KeyPress)) { - const int key = static_cast(event)->key(); - const bool arrowKeyPressed = (key == Qt::Key_Up) || (key == Qt::Key_Down) || - (key == Qt::Key_Left) || (key == Qt::Key_Right); - if (arrowKeyPressed) { + switch (static_cast(event)->key()) { + case Qt::Key_Up: + case Qt::Key_Down: + case Qt::Key_Left: + case Qt::Key_Right: + case Qt::Key_PageUp: + case Qt::Key_PageDown: + case Qt::Key_Home: + case Qt::Key_End: QMetaObject::invokeMethod(this, "scrollToCurrentIndex", Qt::QueuedConnection); + break; + default: + break; } }