aboutsummaryrefslogtreecommitdiffstats
path: root/src/virtualkeyboard
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-02-07 12:17:59 +0200
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2023-02-10 07:52:44 +0200
commit2bd67e9248d0a11d16fe4eec767e663c8e47939e (patch)
treeb7c5e0825357eaa3a60af254a297b50b872e11b4 /src/virtualkeyboard
parente3c7f5dff5a591afdf17c57912cf7e9bbf7eb3b7 (diff)
Fix InputPanel keyboardRectangle binding
The word candidate view was previously accounted to InputPanel.Keyboard height based on visibility. This caused complex binding issues during animations. The word candidate view was also included into keyboardRectangle. This prevented the application from comparing it to the cursorRectangle in binding fullScreenMode on the result. With this change the word candidate list is not accounted to keyboard height anymore. Instead, the height is added to the InputPanel.height. Furthermore, the keyboardRectangle never includes the word candidate list. This allows the application to compare it to the cursorRectangle. Pick-to: 6.5 6.4 Fixes: QTBUG-97830 Change-Id: I40de1bbc9a79da3e0a0cc1de70836bc8bd3289ff Reviewed-by: Inho Lee <inho.lee@qt.io>
Diffstat (limited to 'src/virtualkeyboard')
-rw-r--r--src/virtualkeyboard/InputPanel.qml18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/virtualkeyboard/InputPanel.qml b/src/virtualkeyboard/InputPanel.qml
index 63f2bc5b..676cee67 100644
--- a/src/virtualkeyboard/InputPanel.qml
+++ b/src/virtualkeyboard/InputPanel.qml
@@ -96,6 +96,9 @@ Item {
/*! \internal */
property bool desktopPanel: false
+ /*! \internal */
+ property point screenPos: desktopPanel ? Qt.point(keyboard.x, keyboard.y) : Qt.point(x, y)
+
SelectionControl {
objectName: "selectionControl"
x: -parent.x
@@ -103,10 +106,9 @@ Item {
enabled: active && !keyboard.fullScreenMode && !desktopPanel
}
- implicitHeight: keyboard.height
+ implicitHeight: keyboard.height - keyboard.wordCandidateView.currentYOffset
Keyboard {
id: keyboard
- readonly property real yOffset: keyboard.wordCandidateView.currentYOffset - (keyboard.shadowInputControl.visible ? keyboard.shadowInputControl.height : 0)
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
@@ -127,15 +129,13 @@ Item {
/*! \internal */
function keyboardRectangle() {
- var rect = Qt.rect(0, keyboard.yOffset, keyboard.width, keyboard.height - keyboard.yOffset)
+ var rect = Qt.rect(0, 0, keyboard.width, keyboard.height)
+ const screenPosX = screenPos.x
+ const screenPosY = screenPos.y
if (desktopPanel) {
- rect.x += keyboard.x
- rect.y += keyboard.y
+ rect.x += screenPosX
+ rect.y += screenPosY
}
- // Read the inputPanel position.
- // This ensures that the Binding works.
- var unusedX = inputPanel.x
- var unusedY = inputPanel.y
return mapToItem(null, rect)
}
}