~lukas-kde/unity8/nonPixelatedNotificationIcons

« back to all changes in this revision

Viewing changes to qml/Panel/Indicators/client/IndicatorsList.qml

  • Committer: Bileto Bot
  • Author(s): Marco Trevisan (Treviño)
  • Date: 2016-09-22 07:44:00 UTC
  • mfrom: (2440.28.8 indicators-client-modernize)
  • Revision ID: ci-train-bot@canonical.com-20160922074400-mxzyhbumupv06xb9
IndicatorsClient: use PageHeader and ListItemLayout's

Approved by: Albert Astals Cid

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
 * Copyright 2013 Canonical Ltd.
 
2
 * Copyright 2013-2016 Canonical Ltd.
3
3
 *
4
4
 * This program is free software; you can redistribute it and/or modify
5
5
 * it under the terms of the GNU Lesser General Public License as published by
15
15
 *
16
16
 * Authors:
17
17
 *      Renato Araujo Oliveira Filho <renato@canonical.com>
 
18
 *      Marco Trevisan <marco.trevisan@canonical.com>
18
19
 */
19
20
 
20
21
import QtQuick 2.4
21
22
import Ubuntu.Components 1.3
22
 
import Ubuntu.Components.ListItems 1.3 as ListItem
23
23
import Unity.Indicators 0.1 as Indicators
24
24
import "../.."
25
25
import "../../../Components"
28
28
    id: page
29
29
    anchors.fill: parent
30
30
    property string profile: ""
31
 
    title: "Plugin list"
 
31
    header: PageHeader {
 
32
        title: "Indicators List"
 
33
    }
32
34
 
33
35
    Indicators.IndicatorsModel {
34
36
        id: indicatorsModel
42
44
        anchors.fill: parent
43
45
        model: indicatorsModel
44
46
 
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 {
 
47
        delegate: ListItem {
 
48
            objectName: identifier
 
49
            height: menuItem.height + (divider.visible ? divider.height : 0)
 
50
 
 
51
            ListItemLayout {
53
52
                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("IndicatorRepresentation.qml");
62
 
                    if (new_page.status !== Component.Ready) {
63
 
                        if (new_page.status === Component.Error)
64
 
                            console.error("Error: " + new_page.errorString());
65
 
 
66
 
                        return;
67
 
                    }
68
 
 
69
 
                    page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
 
53
                title.text: identifier
 
54
            }
 
55
 
 
56
            onClicked: {
 
57
                var new_page = Qt.createComponent("IndicatorRepresentation.qml");
 
58
                if (new_page.status !== Component.Ready) {
 
59
                    if (new_page.status === Component.Error)
 
60
                        console.error("Error: " + new_page.errorString());
 
61
 
 
62
                    return;
70
63
                }
 
64
                page.pageStack.push(new_page.createObject(pages), {"indicatorProperties" : model.indicatorProperties });
71
65
            }
72
66
        }
73
67
    }