@@ -0,0 +1,116 @@
2+import Ubuntu.Components 0.1
3+import Ubuntu.Components.ListItems 0.1 as ListItem
4+import Ubuntu.Components.Popups 0.1
9+ property bool expanded
11+ property int startIndex
12+ readonly property double itemHeight: units.gu(5)
15+ UbuntuNumberAnimation {
16+ duration: UbuntuAnimation.SnapDuration
20+ color: Theme.palette.normal.base
22+ height: expanded ? (model.count - startIndex) * itemHeight : itemHeight
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
37+ //property double itemHeight: units.gu(5)
40+ model: optionToggle.model
44+ visible: status === Loader.Ready
45+ property string actionLabel: label
46+ readonly property var splitLabel: actionLabel.match(/(^([-a-z0-9]+):)?(.*)$/)
49+ id: optionToggleEntry
52+ width: optionToggleContent.width
53+ height: optionToggle.itemHeight
56+ if (index === startIndex) {
57+ optionToggle.expanded = optionToggle.expanded ? false : true
59+ print("clicked on", label)
63+ ListItem.ThinDivider {
64+ visible: index > startIndex
71+ leftMargin: units.gu(2)
72+ verticalCenter: parent.verticalCenter
74+ visible: index !== startIndex
77+ name: splitLabel[2] !== undefined ? splitLabel[2] : ""
83+ left: delegateIcon.visible ? delegateIcon.right : parent.left
84+ leftMargin: delegateIcon.visible ? units.gu(1) : units.gu(2)
86+ rightMargin: units.gu(2)
87+ verticalCenter: delegateIcon.visible ? delegateIcon.verticalCenter : parent.verticalCenter
95+ elide: Text.ElideRight
101+ rightMargin: units.gu(2)
102+ verticalCenter: delegateIcon.verticalCenter
105+ visible: index === startIndex
106+ name: optionToggle.height === optionToggle.itemHeight ? "down" : "up"
112+ sourceComponent: (index >= startIndex) ? optionToggleEntry : undefined