Unity 8
 All Classes Functions
ScopeSettingsPage.qml
1 /*
2  * Copyright (C) 2014 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.2
18 import Ubuntu.Components 1.1
19 import Unity 0.2
20 import "../Components"
21 import "ScopeSettings"
22 
23 Item {
24  id: root
25 
26  property var scope: null
27  property var scopeStyle: null
28 
29  signal backClicked()
30 
31  PageHeader {
32  id: header
33  objectName: "pageHeader"
34  width: parent.width
35  title: scope ? scope.name : ""
36  showBackButton: true
37  scopeStyle: root.scopeStyle
38 
39  onBackClicked: root.backClicked()
40  }
41 
42  ListView {
43  id: scopeSettings
44  objectName: "scopeSettings"
45  anchors {
46  top: header.bottom
47  bottom: parent.bottom
48  left: parent.left
49  right: parent.right
50  }
51  model: root.scope ? root.scope.settings : null
52 
53  delegate: ScopeSettingsWidgetFactory {
54  objectName: "scopeSettingItem" + index
55  width: root.width
56  widgetData: model
57  scopeStyle: root.scopeStyle
58 
59  onUpdated: model.value = value;
60  }
61  }
62 }