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 angleFromPrimary: Screen.angleBetween(Screen.primaryOrientation, Screen.orientation)
47 readonly property bool rotatedToPhysical: rotation === angleFromPrimary
49 function matchPhysicalOrientation() {
50 rotation = angleFromPrimary;
53 transformOrigin: Item.Center
57 color: LomiriColors.jet
61 objectName: "virtualTouchPad"
63 oskEnabled: root.oskEnabled
64 showRotateButton: !contentContainer.rotatedToPhysical
66 onRotate: contentContainer.matchPhysicalOrientation();