@@ -15,13 +15,13 @@
17import QtQuick 2.4
17import QtQuick 2.4
18+import Ubuntu.Components 1.3
18import Unity 0.2
19import Unity 0.2
20//! \brief This component loads the widgets based on widgetType.
21//! \brief This component loads the widgets based on widgetType.
25 //! Identifier of the widget.
25 //! Identifier of the widget.
26 property string widgetId: ""
26 property string widgetId: ""
@@ -31,20 +31,48 @@ Loader {
31 //! Widget data, forwarded to the widget as is.
31 //! Widget data, forwarded to the widget as is.
32 property var widgetData: null
32 property var widgetData: null
34− source: widgetSource
34+ implicitHeight: childrenRect.height + title.anchors.topMargin
38+ text: widgetData ? widgetData.title : ""
39+ height: text != "" ? implicitHeight : 0
36− //! \cond private
46+ topMargin: height > 0 ? units.gu(1) : 0
37− readonly property url widgetSource: {
47+ leftMargin: units.gu(2)
38− switch (widgetType) {
48+ rightMargin: anchors.leftMargin
39− case Filters.OptionSelectorFilter: return "FilterOptionSelector.qml";
40− case Filters.RangeInputFilter: return "FilterRangeInput.qml";
52+ property alias active: loader.active
65+ readonly property url widgetSource: {
66+ switch (widgetType) {
67+ case Filters.OptionSelectorFilter: return "FilterOptionSelector.qml";
68+ case Filters.RangeInputFilter: return "FilterRangeInput.qml";
46− onLoaded: {
73+ onLoaded: {
47− item.widgetId = Qt.binding(function() { return root.widgetId } )
74+ item.widgetId = Qt.binding(function() { return root.widgetId } )
48− item.widgetData = Qt.binding(function() { return root.widgetData } )
75+ item.widgetData = Qt.binding(function() { return root.widgetData } )