on c42e54e help sign in
unity8/qml/DeviceConfiguration.qml
81 lines 2.4 kB history raw
1/*
2 * Copyright (C) 2015 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.0
19StateGroup {
20 id: root
22 readonly property int useNativeOrientation: -1
24 property int primaryOrientation: useNativeOrientation
26 property int supportedOrientations: Qt.PortraitOrientation
27 | Qt.InvertedPortraitOrientation
28 | Qt.LandscapeOrientation
29 | Qt.InvertedLandscapeOrientation
31 // Supported values so far:
32 // "phone", "tablet" or "desktop"
33 property string category: "phone"
36 property alias name: root.state
38 states: [
39 State {
40 name: "mako"
41 PropertyChanges {
42 target: root
43 supportedOrientations: Qt.PortraitOrientation
44 | Qt.LandscapeOrientation
45 | Qt.InvertedLandscapeOrientation
46 }
47 },
48 State {
49 name: "krillin"
50 PropertyChanges {
51 target: root
52 supportedOrientations: Qt.PortraitOrientation
53 | Qt.LandscapeOrientation
54 | Qt.InvertedLandscapeOrientation
55 }
56 },
57 State {
58 name: "manta"
59 PropertyChanges {
60 target: root
61 category: "tablet"
62 }
63 },
64 State {
65 name: "flo"
66 PropertyChanges {
67 target: root
68 primaryOrientation: Qt.InvertedLandscapeOrientation
69 category: "tablet"
70 }
71 },
72 State {
73 name: "desktop"
74 PropertyChanges {
75 target: root
76 category: "desktop"
77 }
78 }
79 ]