@@ -24,14 +24,23 @@ import Unity 0.1
2424Loader {
2525 id: root
2626
27+ //! Identifier of the widget.
28+ property string widgetId: ""
29+
30+ //! Type of the widget to display.
31+ property string widgetType: ""
32+
2733 //! Widget data, forwarded to the widget as is.
2834 property var widgetData: null
2935
36+ //! Set to true if the parent preview is displayed.
37+ property bool isCurrentPreview: false
38+
3039 //! Triggered signal forwarded from the widgets.
3140 signal triggered(string widgetId, string actionId, var data)
3241
3342 source: {
34− switch (widgetData && widgetData["type"]) {
43+ switch (type) {
3544 case "audio": return "PreviewAudioPlayback.qml";
3645 case "text": return "PreviewTextSummary.qml";
3746 case "gallery": return "PreviewImageGallery.qml";
@@ -40,11 +49,10 @@ Loader {
4049 }
4150 }
4251
43− Binding {
44− target: root.item
45− when: root.status === Loader.Ready
46− property: "widgetData"
47− value: root.widgetData
52+ onLoaded: {
53+ item.widgetId = Qt.binding(function() { return root.widgetId } )
54+ item.widgetData = Qt.binding(function() { return root.widgetData } )
55+ item.isCurrentPreview = Qt.binding(function() { return root.isCurrentPreview } )
4856 }
4957
5058 Connections {