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