on bbbdccd help sign in
unity8/qml/DisabledScreenNotice.qml
102 lines 2.9 kB history raw
1/*
2 * Copyright (C) 2016 Canonical, Ltd.
3 *
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.
7 *
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.
12 *
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/>.
15 */
17import QtQuick 2.4
18import QtQuick.Layouts 1.1
19import Ubuntu.Components 1.3
20import QtQuick.Window 2.2
21import "Components"
23Item {
24 id: root
26 property bool infoNoteDisplayed: true
28 WallpaperResolver {
29 width: root.width
30 id: wallpaperResolver
31 }
33 Item {
34 id: contentContainer
35 anchors.centerIn: parent
36 height: rotation == 90 || rotation == 270 ? parent.width : parent.height
37 width: rotation == 90 || rotation == 270 ? parent.height : parent.width
39 rotation: {
40 switch (Screen.orientation) {
41 case Qt.PortraitOrientation:
42 return 0;
43 case Qt.LandscapeOrientation:
44 return 270;
45 case Qt.InvertedPortraitOrientation:
46 return 180;
47 case Qt.InvertedLandscapeOrientation:
48 return 90;
49 }
50 }
51 transformOrigin: Item.Center
53 VirtualTouchPad {
54 anchors.fill: parent
56 onPressedChanged: {
57 if (pressed && infoNoteDisplayed) {
58 infoNoteDisplayed = false;
59 }
60 }
61 }
63 Image {
64 anchors.fill: parent
65 source: wallpaperResolver.background
66 }
68 Item {
69 objectName: "infoNoticeArea"
70 anchors.fill: parent
71 opacity: infoNoteDisplayed ? 1 : 0
72 visible: opacity > 0
73 Behavior on opacity {
74 UbuntuNumberAnimation { }
75 }
77 Rectangle {
78 anchors.fill: parent
79 color: "black"
80 opacity: 0.4
81 }
83 Label {
84 id: text
85 anchors.centerIn: parent
86 width: parent.width - units.gu(8)
87 text: i18n.tr("Your device is now connected to an external display. Use this screen as a touch pad to interact with the mouse.")
88 color: "white"
89 horizontalAlignment: Text.AlignHCenter
90 verticalAlignment: Text.AlignVCenter
91 fontSize: "x-large"
92 wrapMode: Text.Wrap
93 }
94 }
96 InputMethod {
97 id: inputMethod
98 objectName: "inputMethod"
99 anchors.fill: parent
100 }
101 }