toggle to show keyboard in the right orientation

This commit is contained in:
talksik
2024-02-12 09:14:50 -08:00
parent 0d9da9bb70
commit 6d52731d1f
+37 -31
View File
@@ -1,5 +1,7 @@
import QtQuick import QtQuick
import QtQuick.VirtualKeyboard import QtQuick.VirtualKeyboard
import QtQuick.Controls
import QtQuick.Layouts
Window { Window {
id: root id: root
@@ -14,43 +16,47 @@ Window {
anchors.centerIn: parent anchors.centerIn: parent
// Rotate 90 degrees clockwise around transformOrigin // Rotate 90 degrees clockwise around transformOrigin
rotation: 90 rotation: 90
// The rotated content
Text { ColumnLayout {
text: qsTr("Hello World") id: column
anchors.centerIn: parent anchors.centerIn: parent
}
MouseArea { Text {
anchors.fill: parent text: qsTr("Hello World")
onClicked: { }
Qt.quit(); RoundButton {
text: "Show keyboard"
onClicked: {
inputPanel.active = !inputPanel.active
}
} }
} }
}
InputPanel { InputPanel {
id: inputPanel id: inputPanel
z: 99 z: 99
x: 0 x: 0
y: root.height y: parent.height
width: root.width width: parent.width
states: State { states: State {
name: "visible" name: "visible"
when: inputPanel.active when: inputPanel.active
PropertyChanges { PropertyChanges {
target: inputPanel target: inputPanel
y: root.height - inputPanel.height y: parent.height - inputPanel.height
}
} }
} transitions: Transition {
transitions: Transition { from: ""
from: "" to: "visible"
to: "visible" reversible: true
reversible: true ParallelAnimation {
ParallelAnimation { NumberAnimation {
NumberAnimation { properties: "y"
properties: "y" duration: 250
duration: 250 easing.type: Easing.InOutQuad
easing.type: Easing.InOutQuad }
} }
} }
} }