~mterry/+junk/u8.2

« back to all changes in this revision

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

  • Committer: Michael Terry
  • Date: 2014-11-17 14:56:04 UTC
  • mfrom: (1317.1.118 unity8)
  • Revision ID: michael.terry@canonical.com-20141117145604-96dn9p5nwkifq2f4
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import QtQuick 2.0
22
22
import Ubuntu.Components 0.1
23
23
import Ubuntu.Components.ListItems 0.1 as ListItem
 
24
import "../.."
24
25
 
25
26
Page {
26
 
    id: page
 
27
    id: root
27
28
 
28
29
    title: indicatorProperties && indicatorProperties.title ?  indicatorProperties.title : ""
29
30
    property variant indicatorProperties
30
 
    property string pageSource : pageLoader.source
31
31
 
32
32
    anchors.fill: parent
33
33
 
44
44
        id: pageLoader
45
45
        objectName: "pageLoader"
46
46
        clip:true
 
47
        asynchronous: true
47
48
 
48
49
        Rectangle {
49
50
            anchors.fill: pageLoader
58
59
            topMargin: units.gu(2)
59
60
            bottomMargin: units.gu(2)
60
61
        }
61
 
        source : visualCheck.checked ? page.pageSource : "IndicatorsTree.qml"
 
62
        sourceComponent: visualCheck.checked ? page : tree
62
63
 
63
 
        onLoaded: {
64
 
            for(var pName in indicatorProperties) {
65
 
                if (item.hasOwnProperty(pName)) {
66
 
                    item[pName] = indicatorProperties[pName];
67
 
                }
68
 
            }
69
 
            item.start();
 
64
        Component {
 
65
            id: page
 
66
            IndicatorPage {
 
67
                identifier: model.identifier
 
68
                busName: indicatorProperties.busName
 
69
                actionsObjectPath: indicatorProperties.actionsObjectPath
 
70
                menuObjectPath: indicatorProperties.menuObjectPath
 
71
            }
 
72
        }
 
73
        Component {
 
74
            id: tree
 
75
            IndicatorsTree {
 
76
                identifier: model.identifier
 
77
                busName: indicatorProperties.busName
 
78
                actionsObjectPath: indicatorProperties.actionsObjectPath
 
79
                menuObjectPath: indicatorProperties.menuObjectPath
 
80
            }
70
81
        }
71
82
    }
72
83
 
85
96
                left: parent.left
86
97
            }
87
98
            text: "Back"
88
 
            onClicked: page.pageStack.reset()
 
99
            onClicked: root.pageStack.reset()
89
100
        }
90
101
    }
91
102
}