aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPekka Gehör <pekka.gehor@siili.com>2019-11-13 09:31:36 +0200
committerRisto Avila <risto.avila@qt.io>2019-11-18 12:36:22 +0000
commit012e4197a6e55fca2e7d69194cac962fa62b56e2 (patch)
treeab14669f4c993df4b92be9e34b3d3c58c5634af1
parent565e0c0277c6fe1085f47fea69c0961df8fa75ff (diff)
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 <mitch.curtis@qt.io> (cherry picked from commit 851b902b7165b0d43d1327ae53f48c66309f14bb) Reviewed-by: Jukka Jokiniva <jukka.jokiniva@qt.io>
-rw-r--r--tests/manual/x11vkbwrapper/Keyboard.qml40
1 files 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
}
}