@@ -11,6 +11,8 @@ UbuntuShape {
11 property int startIndex
11 property int startIndex
12 readonly property double itemHeight: units.gu(5)
12 readonly property double itemHeight: units.gu(5)
14+ signal triggered(string id)
14 Behavior on height {
16 Behavior on height {
15 UbuntuNumberAnimation {
17 UbuntuNumberAnimation {
16 duration: UbuntuAnimation.SnapDuration
18 duration: UbuntuAnimation.SnapDuration
@@ -19,30 +21,24 @@ UbuntuShape {
20 color: Theme.palette.normal.base
22 color: Theme.palette.normal.base
21 borderSource: "none"
23 borderSource: "none"
22− height: expanded ? (model.count - startIndex) * itemHeight : itemHeight
24+ height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
23 width: parent.width
25 width: parent.width
24 radius: "medium"
26 radius: "medium"
25 clip: true
27 clip: true
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
35 id: optionToggleContent
30 id: optionToggleContent
36 width: parent.width
31 width: parent.width
37− //property double itemHeight: units.gu(5)
39 Repeater {
33 Repeater {
34+ id: optionToggleRepeater
40 model: optionToggle.model
35 model: optionToggle.model
42 delegate: Loader {
37 delegate: Loader {
43 asynchronous: true
38 asynchronous: true
44 visible: status === Loader.Ready
39 visible: status === Loader.Ready
45 property string actionLabel: label
40 property string actionLabel: label
41+ property string actionId: id
46 readonly property var splitLabel: actionLabel.match(/(^([-a-z0-9]+):)?(.*)$/)
42 readonly property var splitLabel: actionLabel.match(/(^([-a-z0-9]+):)?(.*)$/)
48 Component {
44 Component {
@@ -56,7 +52,7 @@ UbuntuShape {
56 if (index === startIndex) {
52 if (index === startIndex) {
57 optionToggle.expanded = optionToggle.expanded ? false : true
53 optionToggle.expanded = optionToggle.expanded ? false : true
59− print("clicked on", label)
55+ optionToggle.triggered(actionId)