~nick-dedekind/unity8/indicators.hint-interval

« back to all changes in this revision

Viewing changes to qml/Panel/IndicatorItem.qml

  • Committer: Nick Dedekind
  • Date: 2014-03-07 15:54:57 UTC
  • mfrom: (638.1.118 unity8)
  • Revision ID: nicholas.dedekind@gmail.com-20140307155457-f0s1zu5ll2czt3rq
merged with trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
import Unity.Indicators 0.1 as Indicators
20
20
import "../Components"
21
21
 
22
 
Item {
23
 
    id: indicatorItem
 
22
Loader {
 
23
    id: root
24
24
 
25
 
    property alias widgetSource: loader.source
 
25
    property alias widgetSource: root.source
26
26
    property bool dimmed: false
27
27
    property var indicatorProperties: undefined
28
 
    property bool indicatorVisible: loader.item ? loader.item.enabled : false
 
28
    property bool indicatorVisible: item ? item.enabled : false
29
29
    property string identifier
30
30
 
31
31
    opacity: dimmed ? 0.4 : 1
32
32
    Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
33
33
 
34
 
    width: loader.item ? loader.item.width : 0
35
 
 
36
 
    Loader {
37
 
        id: loader
38
 
 
39
 
        onLoaded: {
40
 
            item.height = Qt.binding(function() { return indicatorItem.height; });
41
 
 
42
 
            for(var pName in indicatorProperties) {
43
 
                if (item.hasOwnProperty(pName)) {
44
 
                    item[pName] = indicatorProperties[pName];
45
 
                }
 
34
    onLoaded: {
 
35
        for(var pName in indicatorProperties) {
 
36
            if (item.hasOwnProperty(pName)) {
 
37
                item[pName] = indicatorProperties[pName];
46
38
            }
47
39
        }
 
40
    }
48
41
 
49
 
        Binding {
50
 
            target: loader.item
51
 
            property: "objectName"
52
 
            value: identifier + "-widget"
53
 
        }
 
42
    Binding {
 
43
        target: item
 
44
        property: "objectName"
 
45
        value: identifier + "-widget"
54
46
    }
55
47
}