summaryrefslogtreecommitdiffstats
path: root/basicsuite/shared/SharedMain.qml
diff options
context:
space:
mode:
Diffstat (limited to 'basicsuite/shared/SharedMain.qml')
-rw-r--r--basicsuite/shared/SharedMain.qml80
1 files changed, 48 insertions, 32 deletions
diff --git a/basicsuite/shared/SharedMain.qml b/basicsuite/shared/SharedMain.qml
index 301ccb8..fabd9f5 100644
--- a/basicsuite/shared/SharedMain.qml
+++ b/basicsuite/shared/SharedMain.qml
@@ -15,44 +15,60 @@
** contact form at http://www.qt.io
**
****************************************************************************/
-import QtQuick 2.0
+import QtQuick 2.4
+import QtQuick.Window 2.2
import QtQuick.Enterprise.VirtualKeyboard 1.2
-Item {
- id: root
+Window {
+ id: window
- Loader {
- anchors.left: parent.left
- anchors.top: parent.top
- anchors.right: parent.right
- anchors.bottom: inputPanel.top
- source: "main.qml"
- }
+ visible: true
+ width: Screen.desktopAvailableWidth
+ height: Screen.desktopAvailableHeight
- InputPanel {
- id: inputPanel
- z: 99
- y: root.height
- anchors.left: root.left
- anchors.right: root.right
+ color: "black"
- states: State {
- name: "visible"
- when: Qt.inputMethod.visible
- PropertyChanges {
- target: inputPanel
- y: root.height - inputPanel.height
- }
+ Item {
+ id: root
+ anchors.centerIn: window.contentItem
+ property bool portraitMode: Screen.desktopAvailableHeight > Screen.desktopAvailableWidth ? true : false
+ rotation: portraitMode ? 90 : 0
+ width: portraitMode ? window.height : window.width
+ height: portraitMode ? window.width : window.height
+
+ Loader {
+ anchors.left: parent.left
+ anchors.top: parent.top
+ anchors.right: parent.right
+ anchors.bottom: inputPanel.top
+ source: "main.qml"
}
- transitions: Transition {
- from: ""
- to: "visible"
- reversible: true
- ParallelAnimation {
- NumberAnimation {
- properties: "y"
- duration: 250
- easing.type: Easing.InOutQuad
+
+ InputPanel {
+ id: inputPanel
+ z: 99
+ y: root.height
+ anchors.left: root.left
+ anchors.right: root.right
+
+ states: State {
+ name: "visible"
+ when: Qt.inputMethod.visible
+ PropertyChanges {
+ target: inputPanel
+ y: root.height - inputPanel.height
+ }
+ }
+ transitions: Transition {
+ from: ""
+ to: "visible"
+ reversible: true
+ ParallelAnimation {
+ NumberAnimation {
+ properties: "y"
+ duration: 250
+ easing.type: Easing.InOutQuad
+ }
}
}
}