Unity 8
DeviceConfiguration.qml
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  */
16 
17 import QtQuick 2.0
18 
19 StateGroup {
20  id: root
21 
22  readonly property int useNativeOrientation: -1
23 
24  property int primaryOrientation: useNativeOrientation
25 
26  property int supportedOrientations: Qt.PortraitOrientation
27  | Qt.InvertedPortraitOrientation
28  | Qt.LandscapeOrientation
29  | Qt.InvertedLandscapeOrientation
30 
31  // Supported values so far:
32  // "phone", "tablet" or "desktop"
33  property string category: "phone"
34 
35  property int ignoredMice: 0
36 
37 
38  property alias name: root.state
39 
40  states: [
41  State {
42  name: "mako"
43  PropertyChanges {
44  target: root
45  supportedOrientations: Qt.PortraitOrientation
46  | Qt.LandscapeOrientation
47  | Qt.InvertedLandscapeOrientation
48  }
49  },
50  State {
51  name: "krillin"
52  PropertyChanges {
53  target: root
54  supportedOrientations: Qt.PortraitOrientation
55  | Qt.LandscapeOrientation
56  | Qt.InvertedLandscapeOrientation
57  }
58  },
59  State {
60  name: "arale"
61  PropertyChanges {
62  target: root
63  supportedOrientations: Qt.PortraitOrientation
64  | Qt.LandscapeOrientation
65  | Qt.InvertedLandscapeOrientation
66  ignoredMice: 1
67  }
68  },
69  State {
70  name: "manta"
71  PropertyChanges {
72  target: root
73  category: "tablet"
74  }
75  },
76  State {
77  name: "flo"
78  PropertyChanges {
79  target: root
80  primaryOrientation: Qt.InvertedLandscapeOrientation
81  category: "tablet"
82  }
83  },
84  State {
85  name: "desktop"
86  PropertyChanges {
87  target: root
88  category: "desktop"
89  }
90  }
91  ]
92 
93 }