aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrigorii Zimin <gzimin@luxoft.com>2020-07-08 17:42:08 +0300
committerGrigorii Zimin <gzimin@luxoft.com>2020-07-22 09:16:12 +0000
commit4e8b40ef55f48bca2c633efe93693d8be8431a7d (patch)
tree57a20ddb217143842e35afaab00cfa5d0f933ed7
parent8a6fe220f4470f7b16c3974e8fbeb218faa5ea73 (diff)
[CentralConsole] adapt virtualKeyboard
new InputPanel from QtQuick.VirtualKeyboard automatically calculates self height, only two properties to control arrangement are 'y' and 'width' Change-Id: Idb9fe28287b4c4db4402c221554743f27cc3aebc Reviewed-by: Egor Nemtsev <enemtsev@luxoft.com> Reviewed-by: Svetlana Abramenkova <sabramenkova@luxoft.com>
-rw-r--r--sysui/centerconsole/AbstractCenterConsole.qml10
-rw-r--r--sysui/centerconsole/VirtualKeyboard.qml18
2 files changed, 19 insertions, 9 deletions
diff --git a/sysui/centerconsole/AbstractCenterConsole.qml b/sysui/centerconsole/AbstractCenterConsole.qml
index ac2c2cbb..203c5532 100644
--- a/sysui/centerconsole/AbstractCenterConsole.qml
+++ b/sysui/centerconsole/AbstractCenterConsole.qml
@@ -196,10 +196,14 @@ Item {
id: virtualKeyboard
asynchronous: true
source: "VirtualKeyboard.qml"
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.bottom: parent.bottom
+ anchors.horizontalCenter: root.horizontalCenter
+ anchors.bottom: root.bottom
+ width: root.width
z: 101
+
+ onLoaded: {
+ item.parentRotation = Qt.binding(() => root.rotation);
+ }
}
UIShortcuts {
diff --git a/sysui/centerconsole/VirtualKeyboard.qml b/sysui/centerconsole/VirtualKeyboard.qml
index 96836015..a201317d 100644
--- a/sysui/centerconsole/VirtualKeyboard.qml
+++ b/sysui/centerconsole/VirtualKeyboard.qml
@@ -40,24 +40,31 @@ Item {
id: root
readonly property bool isOpen: inputPanel.state === "active"
-
+ property real parentRotation: 0
height: inputPanel.height
InputPanel {
id: inputPanel
- anchors.left: parent.left
- anchors.right: parent.right
+ width: root.width
+ rotation: parentRotation
+ transformOrigin: Item.TopLeft
states: [
State {
name: "active"
when: inputPanel.active
- PropertyChanges { target: inputPanel; y: 0; visible: true }
+ PropertyChanges {
+ target: inputPanel; y: root.mapToItem(null, 0, 0).y;
+ visible: true; x: root.mapToItem(null, 0, 0).x
+ }
},
State {
name: "hidden"
when: !inputPanel.active
- PropertyChanges { target: inputPanel; y: height; visible: false }
+ PropertyChanges {
+ target: inputPanel; y: root.mapToItem(null, 0, 0).y + height;
+ visible: false; x: root.mapToItem(null, 0, 0).x
+ }
}
]
@@ -73,6 +80,5 @@ Item {
DefaultNumberAnimation { target: inputPanel; property: "y" }
}
]
-
}
}