@@ -11,6 +11,8 @@ UbuntuShape {
1111 property int startIndex
1212 readonly property double itemHeight: units.gu(5)
1313
14+ signal triggered(string id)
15+
1416 Behavior on height {
1517 UbuntuNumberAnimation {
1618 duration: UbuntuAnimation.SnapDuration
@@ -19,30 +21,24 @@ UbuntuShape {
1921
2022 color: Theme.palette.normal.base
2123 borderSource: "none"
22− height: expanded ? (model.count - startIndex) * itemHeight : itemHeight
24+ height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
2325 width: parent.width
2426 radius: "medium"
2527 clip: true
2628
27− onExpandedChanged: {
28− print("expanded changed to:", expanded ? "true" : "false")
29− print("height:", height)
30− print("count:", model.count)
31− optionToggle.height = expanded ? (model.count - startIndex) * itemHeight : itemHeight
32− }
33−
3429 Column {
3530 id: optionToggleContent
3631 width: parent.width
37− //property double itemHeight: units.gu(5)
3832
3933 Repeater {
34+ id: optionToggleRepeater
4035 model: optionToggle.model
4136
4237 delegate: Loader {
4338 asynchronous: true
4439 visible: status === Loader.Ready
4540 property string actionLabel: label
41+ property string actionId: id
4642 readonly property var splitLabel: actionLabel.match(/(^([-a-z0-9]+):)?(.*)$/)
4743
4844 Component {
@@ -56,7 +52,7 @@ UbuntuShape {
5652 if (index === startIndex) {
5753 optionToggle.expanded = optionToggle.expanded ? false : true
5854 } else {
59− print("clicked on", label)
55+ optionToggle.triggered(actionId)
6056 }
6157 }
6258