Unity 8
 All Classes Functions
IndicatorsList.qml
1 /*
2  * Copyright 2013 Canonical Ltd.
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
12  *
13  * You should have received a copy of the GNU Lesser General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * Authors:
17  * Renato Araujo Oliveira Filho <renato@canonical.com>
18  */
19 
20 import QtQuick 2.0
21 import Ubuntu.Components 0.1
22 import Ubuntu.Components.ListItems 0.1 as ListItem
23 import Unity.Indicators 0.1 as Indicators
24 import "../.."
25 import "../../../Components/Flickables" as Flickables
26 
27 Page {
28  id: page
29  anchors.fill: parent
30  property string profile: ""
31  title: "Plugin list"
32 
33  Indicators.IndicatorsModel {
34  id: indicatorsModel
35 
36  Component.onCompleted: load(profile)
37  }
38 
39  Flickables.ListView {
40  id: mainMenu
41  objectName: "mainMenu"
42  anchors.fill: parent
43  model: indicatorsModel
44 
45  delegate: Rectangle {
46  color: "#221e1c"
47 
48  anchors.left: parent.left
49  anchors.right: parent.right
50  height: menuItem.height
51 
52  ListItem.Standard {
53  id: menuItem
54  anchors.left: parent.left
55  anchors.right: parent.right
56  objectName: identifier
57 
58  text: identifier
59 
60  onClicked: {
61  var new_page = Qt.createComponent("IndicatorsPage.qml");
62  page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties, "pageSource" : model.pageSource});
63  }
64  }
65  }
66  }
67 }