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/>.
18import QtQuick.Layouts 1.1
19import Lomiri.Components 1.3
20import Lomiri.Session 0.1
21import QtQuick.Window 2.2
22import WindowManager 1.0
28 property var screen: null
29 property var orientationLock: OrientationLock
30 property alias overrideDeviceName: root.deviceConfiguration.overrideName
32 property bool oskEnabled: false
34 property alias deviceConfiguration: _deviceConfiguration
36 id: _deviceConfiguration
41 objectName: "contentContainer"
42 anchors.centerIn: parent
43 height: rotation == 90 || rotation == 270 ? parent.width : parent.height
44 width: rotation == 90 || rotation == 270 ? parent.height : parent.width
46 property int savedOrientation: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
47 ? (root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation)
48 : deviceConfiguration.primaryOrientation
51 var usedOrientation = root.screen.orientation;
53 if (root.orientationLock.enabled) {
54 usedOrientation = savedOrientation;
57 savedOrientation = usedOrientation;
59 switch (usedOrientation) {
60 case Qt.PortraitOrientation:
62 case Qt.LandscapeOrientation:
64 case Qt.InvertedPortraitOrientation:
66 case Qt.InvertedLandscapeOrientation:
72 transformOrigin: Item.Center
76 color: LomiriColors.jet
80 objectName: "virtualTouchPad"
82 oskEnabled: root.oskEnabled