summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2020-03-27 15:10:47 +0200
committerSamuli Piippo <samuli.piippo@qt.io>2020-04-06 07:51:16 +0000
commitabbfc9fea93e5e72b6669d0cd086f7ba21805578 (patch)
tree3e0a2534974d1c2d7bcca863263f4e9551d287cd
parent4d1c99f7214dd1638e43af217758e1a9b9c25f10 (diff)
Better handling of VKB when screen is rotated5.15
Resize and reposition the Qt Virtual Keyboard based on the display orientation. Contains workaround values for the aligment when display is in portrait mode, as VKB does not align itself as you would expect. Task-number: QTBUG-83217 Change-Id: I99f9cd332f61850d1a47b2efba335242f8d82e89 Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
-rw-r--r--qml/MainWindow.qml28
1 files changed, 23 insertions, 5 deletions
diff --git a/qml/MainWindow.qml b/qml/MainWindow.qml
index c1f4e54..686dd87 100644
--- a/qml/MainWindow.qml
+++ b/qml/MainWindow.qml
@@ -275,10 +275,16 @@ Item {
InputPanel {
id: inputPanel
z: 99
- y: root.height
- anchors.left: root.left
- anchors.right: root.right
- visible: y < root.height
+ x: root.portraitMode ?
+ (globalSettings.rotationSelected ?
+ inputPanel.height + root.height : -inputPanel.height - root.height) :
+ 0
+ y: root.portraitMode ?
+ (globalSettings.rotationSelected ? inputPanel.height : inputPanel.height) :
+ (globalSettings.rotationSelected ? -root.height : root.height)
+ width: root.portraitMode ? window.height : window.width
+ rotation: root.rotation
+ property real alignmentWorkaround: height * 0.1
onActiveChanged: {
if (!active)
applicationLoader.anchors.topMargin = 0;
@@ -296,7 +302,14 @@ Item {
when: inputPanel.active
PropertyChanges {
target: inputPanel
- y: root.height - inputPanel.height
+ x: root.portraitMode ?
+ (globalSettings.rotationSelected ?
+ root.height - inputPanel.height * 2 - inputPanel.alignmentWorkaround :
+ -inputPanel.height - inputPanel.alignmentWorkaround) :
+ 0
+ y: root.portraitMode ?
+ inputPanel.height + inputPanel.alignmentWorkaround :
+ (globalSettings.rotationSelected ? 0 : root.height - inputPanel.height)
}
}
@@ -306,6 +319,11 @@ Item {
reversible: true
ParallelAnimation {
NumberAnimation {
+ properties: "x"
+ duration: 250
+ easing.type: Easing.InOutQuad
+ }
+ NumberAnimation {
properties: "y"
duration: 250
easing.type: Easing.InOutQuad