┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/dolphinviewautoscroller.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2008-12-11 19:24:49 +0000
committerPeter Penz <[email protected]>2008-12-11 19:24:49 +0000
commitaa5ffc8d89170b8e381f10ec846b07c1d81ec4e7 (patch)
treedd6882a9013947bddfe6259e1322f182c98c7c3c /src/dolphinviewautoscroller.cpp
parenta98a8127cca3dcd0d6a148decf7e1e2ba12fb875 (diff)
Include page-up, page-down, home + end as keys that need autoscrolling. Thanks to Frank Reininghaus for the patch!
CCBUG: 165531 svn path=/trunk/KDE/kdebase/apps/; revision=895788
Diffstat (limited to 'src/dolphinviewautoscroller.cpp')
-rw-r--r--src/dolphinviewautoscroller.cpp16
1 files changed, 12 insertions, 4 deletions
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<QKeyEvent*>(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<QKeyEvent*>(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;
}
}