summaryrefslogtreecommitdiffstats
path: root/src/gui/text/qtextcontrol.cpp
diff options
context:
space:
mode:
authorAlessandro Portale <aportale@trolltech.com>2009-09-19 11:37:38 (GMT)
committerAlessandro Portale <aportale@trolltech.com>2009-09-19 11:37:38 (GMT)
commitcd48ed92670a0d086589b202364f38f14e7221c9 (patch)
treea3e9d51e75822a1380699d7cd5fb87ee1522239d /src/gui/text/qtextcontrol.cpp
parent3581668cd0ffbe47a05ce7467f8d89b8c9bb6101 (diff)
downloadQt-cd48ed92670a0d086589b202364f38f14e7221c9.zip
Qt-cd48ed92670a0d086589b202364f38f14e7221c9.tar.gz
Qt-cd48ed92670a0d086589b202364f38f14e7221c9.tar.bz2
Making Keypad Navigation more usable
All changes of this commit are #ifdef'ed in QT_KEYPAD_NAVIGATION. Most desktop Qts won't notice any change. Navigating between QWidgets was not alwys a pleasure on keypad devices. This commit fixes the navigation behavior for some widgets, mostly itemviews. Furthermore, it adds a 'directional' navigation mode. Until now, the existing keypad navigation used the tab order do go back and forth between widgets. The new mode is supposed to provide a more intuitive navigation. It is the new default mode on Symbian. Screens (and their resolutions) become bigger, and also low resolution screens can be used in landscape mode. That's why the directional mode was requested. Another popular request was to put some more convenience into QSlider: If a (horizontal) slider has focus and the user presses left/right, the value of the slider may directing change without being selected (edit mode). This commit also adds the manual test 'keypadnavigation'. Reviewed-by: Shane Kearns
Diffstat (limited to 'src/gui/text/qtextcontrol.cpp')
-rw-r--r--src/gui/text/qtextcontrol.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gui/text/qtextcontrol.cpp b/src/gui/text/qtextcontrol.cpp
index 25006b1..6def06e 100644
--- a/src/gui/text/qtextcontrol.cpp
+++ b/src/gui/text/qtextcontrol.cpp
@@ -271,7 +271,9 @@ bool QTextControlPrivate::cursorMoveKeyEvent(QKeyEvent *e)
}
#ifdef QT_KEYPAD_NAVIGATION
else if (QApplication::keypadNavigationEnabled()
- && (e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)) {
+ && ((e->key() == Qt::Key_Up || e->key() == Qt::Key_Down)
+ || QApplication::navigationMode() == Qt::NavigationModeKeypadDirectional
+ && (e->key() == Qt::Key_Left || e->key() == Qt::Key_Right))) {
return false;
}
#endif