2 * Copyright (C) 2016 Canonical, Ltd.
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; version 3.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 import QtQuick.Layouts 1.1
19 import Ubuntu.Components 1.3
20 import Unity.Session 0.1
21 import QtQuick.Window 2.2
28 property var screen: Screen
29 property var orientationLock: OrientationLock
32 id: deviceConfiguration
33 name: applicationArguments.deviceName
38 objectName: "contentContainer"
39 anchors.centerIn: parent
40 height: rotation == 90 || rotation == 270 ? parent.width : parent.height
41 width: rotation == 90 || rotation == 270 ? parent.height : parent.width
43 property int savedOrientation: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
44 ? (root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation)
45 : deviceConfiguration.primaryOrientation
48 var usedOrientation = root.screen.orientation;
50 if (root.orientationLock.enabled) {
51 usedOrientation = savedOrientation;
54 savedOrientation = usedOrientation;
56 switch (usedOrientation) {
57 case Qt.PortraitOrientation:
59 case Qt.LandscapeOrientation:
61 case Qt.InvertedPortraitOrientation:
63 case Qt.InvertedLandscapeOrientation:
69 transformOrigin: Item.Center
73 color: UbuntuColors.jet
77 objectName: "virtualTouchPad"