diff options
author | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-22 23:25:59 +0300 |
---|---|---|
committer | Jarkko Koivikko <jarkko.koivikko@code-q.fi> | 2018-08-30 07:03:51 +0000 |
commit | 7f12d8bb06e7cdc932cfcc7a8d1eaf12b74e8eff (patch) | |
tree | 981632136944d0c7315d4db806c980c15a43c26d /src | |
parent | 7d764eecbf69969661003c9f7874fde1e99fcc2a (diff) |
Fix regression in arrow key navigation
When word candidate view contained items and an alternative
keys view was opened by long press key, the word candidate
item was selected together with alternative key.
This regression was introduced in commit e803aec1ea21fd00e13b9535a4b536cc43c26ee4
Change-Id: Ie6f7e1580ddcc5327104eafafc3a10c86e9abb65
Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi>
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/virtualkeyboard/content/components/Keyboard.qml | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/virtualkeyboard/content/components/Keyboard.qml b/src/virtualkeyboard/content/components/Keyboard.qml index bd885f73..47566e55 100644 --- a/src/virtualkeyboard/content/components/Keyboard.qml +++ b/src/virtualkeyboard/content/components/Keyboard.qml @@ -360,12 +360,6 @@ Item { keyboardInputArea.reset() keyboardInputArea.navigateToNextKey(0, 0, false) } - } else if (alternativeKeys.active) { - if (!isAutoRepeat) { - alternativeKeys.clicked() - keyboardInputArea.reset() - keyboardInputArea.navigateToNextKey(0, 0, false) - } } else if (keyboardInputArea.initialKey) { if (!isAutoRepeat) { pressAndHoldTimer.restart() @@ -406,6 +400,15 @@ Item { } else { wordCandidateContextMenu.openedByNavigationKeyLongPress = false } + } else if (alternativeKeys.active) { + if (!alternativeKeys.openedByNavigationKeyLongPress) { + alternativeKeys.clicked() + alternativeKeys.close() + keyboardInputArea.navigateToNextKey(0, 0, false) + keyboardInputArea.reset() + } else { + alternativeKeys.openedByNavigationKeyLongPress = false + } } else if (!wordCandidateContextMenu.active && wordCandidateView.count > 0) { wordCandidateView.model.selectItem(wordCandidateView.currentIndex) if (!InputContext.preeditText.length) @@ -454,9 +457,12 @@ Item { keyboard.y + alternativeKeys.listView.y - verticalMargin, alternativeKeys.listView.width + horizontalMargin * 2, alternativeKeys.listView.height + verticalMargin * 2) + property bool openedByNavigationKeyLongPress onVisibleChanged: { if (visible) InputContext.priv.previewRectangle = Qt.binding(function() {return previewRect}) + else + openedByNavigationKeyLongPress = false InputContext.priv.previewVisible = visible } } @@ -469,6 +475,7 @@ Item { if (alternativeKeys.open(keyboard.activeKey, origin.x, origin.y)) { InputContext.inputEngine.virtualKeyCancel() keyboardInputArea.initialKey = null + alternativeKeys.openedByNavigationKeyLongPress = keyboard.navigationModeActive } else if (keyboard.activeKey.key === Qt.Key_Context1) { InputContext.inputEngine.virtualKeyCancel() keyboardInputArea.dragSymbolMode = true @@ -488,7 +495,7 @@ Item { keyboardInputArea.navigateToNextKey(0, 0, false) } else if (!wordCandidateContextMenu.active) { wordCandidateContextMenu.show(wordCandidateView.currentIndex) - wordCandidateContextMenu.openedByNavigationKeyLongPress = true + wordCandidateContextMenu.openedByNavigationKeyLongPress = keyboard.navigationModeActive } } } |