on xenial help sign in
IndicatorsList: use ListItemLayout and PageHeader
commitb7351319e5501989152d1f7af6f669b6f000f55a authorMarco Trevisan (Treviño) <mail@3v1n0.net> dateWed 15 Jun 2016, 17:36 (10 years ago) parent8df2bdc
1 file changed+18−24
qml/Panel/Indicators/client/IndicatorsList.qml+18−24
qml/Panel/Indicators/client/IndicatorsList.qml+18−24
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -15,11 +15,11 @@
1515 *
1616 * Authors:
1717 * Renato Araujo Oliveira Filho <renato@canonical.com>
18+ * Marco Trevisan <marco.trevisan@canonical.com>
1819 */
1920
2021import QtQuick 2.4
2122import Ubuntu.Components 1.3
22−import Ubuntu.Components.ListItems 1.3 as ListItem
2323import Unity.Indicators 0.1 as Indicators
2424import "../.."
2525
@@ -27,7 +27,9 @@ Page {
2727 id: page
2828 anchors.fill: parent
2929 property string profile: ""
30− title: "Plugin list"
30+ header: PageHeader {
31+ title: "Indicators List"
32+ }
3133
3234 Indicators.IndicatorsModel {
3335 id: indicatorsModel
@@ -41,32 +43,24 @@ Page {
4143 anchors.fill: parent
4244 model: indicatorsModel
4345
44− delegate: Rectangle {
45− color: "#221e1c"
46−
47− anchors.left: parent.left
48− anchors.right: parent.right
49− height: menuItem.height
46+ delegate: ListItem {
47+ objectName: identifier
48+ height: menuItem.height + (divider.visible ? divider.height : 0)
5049
51− ListItem.Standard {
50+ ListItemLayout {
5251 id: menuItem
53− anchors.left: parent.left
54− anchors.right: parent.right
55− objectName: identifier
56−
57− text: identifier
58−
59− onClicked: {
60− var new_page = Qt.createComponent("IndicatorRepresentation.qml");
61− if (new_page.status !== Component.Ready) {
62− if (new_page.status === Component.Error)
63− console.error("Error: " + new_page.errorString());
52+ title.text: identifier
53+ }
6454
65− return;
66− }
55+ onClicked: {
56+ var new_page = Qt.createComponent("IndicatorRepresentation.qml");
57+ if (new_page.status !== Component.Ready) {
58+ if (new_page.status === Component.Error)
59+ console.error("Error: " + new_page.errorString());
6760
68− page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
61+ return;
6962 }
63+ page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
7064 }
7165 }
7266 }