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
27 property bool infoNoteDisplayed: true
30 property var screen: Screen
31 property var orientationLock: OrientationLock
34 id: deviceConfiguration
35 name: applicationArguments.deviceName
40 objectName: "contentContainer"
41 anchors.centerIn: parent
42 height: rotation == 90 || rotation == 270 ? parent.width : parent.height
43 width: rotation == 90 || rotation == 270 ? parent.height : parent.width
45 property int savedOrientation: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
46 ? (root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation)
47 : deviceConfiguration.primaryOrientation
50 var usedOrientation = root.screen.orientation;
52 if (root.orientationLock.enabled) {
53 usedOrientation = savedOrientation;
56 savedOrientation = usedOrientation;
58 switch (usedOrientation) {
59 case Qt.PortraitOrientation:
61 case Qt.LandscapeOrientation:
63 case Qt.InvertedPortraitOrientation:
65 case Qt.InvertedLandscapeOrientation:
71 transformOrigin: Item.Center
77 if (pressed && infoNoteDisplayed) {
78 infoNoteDisplayed = false;
89 objectName: "infoNoticeArea"
91 opacity: infoNoteDisplayed ? 1 : 0
94 UbuntuNumberAnimation { }
98 anchors.centerIn: parent
99 width: parent.width - units.gu(8)
104 text: i18n.tr("Your device is now connected to an external display. Use this screen as a touch pad to interact with the pointer.")
113 name: "input-touchpad-symbolic"
115 anchors.horizontalCenter: parent.horizontalCenter
122 objectName: "inputMethod"