aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-09-03 23:33:42 +0300
committerDaniel Smith <Daniel.Smith@qt.io>2023-09-13 20:46:20 +0000
commitd191509132d1d10737a5f83cbed421419ccf0582 (patch)
tree2b73088b869dd5c541e9f55569a34c644dddbda1
parent94695f16c02e46efedf5490895e8303732150ad8 (diff)
Fix navigation key left/right handling with LayoutMirroring.enabled
When LayoutMirroring.enabled is true, right navigation key should wrap to line above and left navigation key should wrap to line below. Pick-to: 6.5 Change-Id: Iec7c4cd4372ba5a511acb30e04b46c5dcc56d149 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> (cherry picked from commit 37c315808d43e42894d61c4e10eb9bb40f9b46a7) Reviewed-by: Daniel Smith <Daniel.Smith@qt.io>
-rw-r--r--src/components/Keyboard.qml17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/components/Keyboard.qml b/src/components/Keyboard.qml
index 38dd6cd2..45ca8dca 100644
--- a/src/components/Keyboard.qml
+++ b/src/components/Keyboard.qml
@@ -211,22 +211,19 @@ Item {
}
}
initialKey = keyboardInputArea.initialKey
- if (!keyboardInputArea.navigateToNextKey(-1, 0, false)) {
+ if (!keyboardInputArea.navigateToNextKey(-1 * direction, 0, false)) {
keyboardInputArea.initialKey = initialKey
if (!keyboardInputArea.navigateToNextKey(0, -1 * direction, false)) {
if (wordCandidateView.count) {
- if (wordCandidateView.count) {
- wordCandidateView.currentIndex =
- wordCandidateView.effectiveLayoutDirection == Qt.LeftToRight ?
- (wordCandidateView.count - 1) : 0
- break
- }
+ wordCandidateView.currentIndex =
+ wordCandidateView.effectiveLayoutDirection == Qt.LeftToRight ?
+ (wordCandidateView.count - 1) : 0
break
}
keyboardInputArea.initialKey = initialKey
keyboardInputArea.navigateToNextKey(0, -1 * direction, true)
}
- keyboardInputArea.navigateToNextKey(-1, 0, true)
+ keyboardInputArea.navigateToNextKey(-1 * direction, 0, true)
}
break
case Qt.Key_Up:
@@ -323,7 +320,7 @@ Item {
}
}
initialKey = keyboardInputArea.initialKey
- if (!keyboardInputArea.navigateToNextKey(1, 0, false)) {
+ if (!keyboardInputArea.navigateToNextKey(1 * direction, 0, false)) {
keyboardInputArea.initialKey = initialKey
if (!keyboardInputArea.navigateToNextKey(0, 1 * direction, false)) {
if (wordCandidateView.count) {
@@ -335,7 +332,7 @@ Item {
keyboardInputArea.initialKey = initialKey
keyboardInputArea.navigateToNextKey(0, 1 * direction, true)
}
- keyboardInputArea.navigateToNextKey(1, 0, true)
+ keyboardInputArea.navigateToNextKey(1 * direction, 0, true)
}
break
case Qt.Key_Down: