on xenial help sign in
IndicatorItem as Loader
commit0428e3de1ff021948badbf4616d1b8bd0084f6d2 authorNick Dedekind <nicholas.dedekind@gmail.com> dateMon 3 Mar 2014, 11:54 (13 years ago) parent0d7adc0
1 file changed+13−21
qml/Panel/IndicatorItem.qml+13−21
qml/Panel/IndicatorItem.qml+13−21
@@ -19,37 +19,29 @@ import Ubuntu.Components 0.1
1919import Unity.Indicators 0.1 as Indicators
2020import "../Components"
2121
22−Item {
23− id: indicatorItem
22+Loader {
23+ id: root
2424
25− property alias widgetSource: loader.source
25+ property alias widgetSource: root.source
2626 property bool dimmed: false
2727 property var indicatorProperties: undefined
28− property bool indicatorVisible: loader.item ? loader.item.enabled : false
28+ property bool indicatorVisible: item ? item.enabled : false
2929 property string identifier
3030
3131 opacity: dimmed ? 0.4 : 1
3232 Behavior on opacity { UbuntuNumberAnimation { duration: UbuntuAnimation.BriskDuration } }
3333
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];
4638 }
4739 }
40+ }
4841
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"
5446 }
5547}