From 012e4197a6e55fca2e7d69194cac962fa62b56e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pekka=20Geh=C3=B6r?= Date: Wed, 13 Nov 2019 09:31:36 +0200 Subject: Workaround for a alternative characters issue When you use DragHandler all over the InputPanel, it block use a alternative characters. Now you can only use DragHandler at the top of the Window. Change-Id: I4b648ee56af42a7fff136f1961981dd7ef594337 Reviewed-by: Mitch Curtis (cherry picked from commit 851b902b7165b0d43d1327ae53f48c66309f14bb) Reviewed-by: Jukka Jokiniva --- tests/manual/x11vkbwrapper/Keyboard.qml | 40 +++++++++++++++++++++++++++------ 1 file changed, 33 insertions(+), 7 deletions(-) diff --git a/tests/manual/x11vkbwrapper/Keyboard.qml b/tests/manual/x11vkbwrapper/Keyboard.qml index 4ead6daf..152bdb98 100644 --- a/tests/manual/x11vkbwrapper/Keyboard.qml +++ b/tests/manual/x11vkbwrapper/Keyboard.qml @@ -35,7 +35,7 @@ import Qt.labs.platform 1.1 Window { id: keyboardWindow width: Screen.width / 2 - height: width / 3.2 + height: width / 2.65 y: Screen.height - height color: "transparent" visible: Qt.inputMethod.visible @@ -44,6 +44,11 @@ Window { readonly property double scaleFactor: 1.5 signal languageChangedSignal(string msg) + QtObject { + id: d + property double alternativeKeySpaceHeight: inputPanel.height / 4.7 + } + Loader { id: testLoader sourceComponent: { @@ -54,13 +59,13 @@ Window { } Component { - id: lang + id: lang Text { id: langText visible: false text: qsTr(Qt.locale(InputContext.locale).nativeLanguageName) onTextChanged: { - keyboardWindow.languageChangedSignal(langText.text) + keyboardWindow.languageChangedSignal(langText.text) } } } @@ -76,11 +81,12 @@ Window { Component.onCompleted: console.log("Found system tray?:",qtLogo.available) } - InputPanel { - id: inputPanel - z: 99 + Rectangle { + id: dragArea anchors.fill: parent - + anchors.bottomMargin: keyboardWindow.height - d.alternativeKeySpaceHeight + color: "#aa444444" + opacity: hoverHandler.hovered ? 1 : 0 DragHandler { target: null onTranslationChanged: { @@ -101,5 +107,25 @@ Window { keyboardWindow.y += dy } } + + HoverHandler { + id: hoverHandler + } + + Behavior on opacity { + NumberAnimation {} + } + Text { + text: "Click here and then drag to move the keyboard" + color: "white" + anchors.horizontalCenter: parent.horizontalCenter + y: (d.alternativeKeySpaceHeight - height) / 2 + } + } + + InputPanel { + id: inputPanel + z: 99 + anchors.fill: parent } } -- cgit v1.2.3