From 5b8116bec4046af2ed36e9b3a1749c0dbbd2a047 Mon Sep 17 00:00:00 2001 From: Sam Gateau Date: Thu, 7 Mar 2019 17:52:11 -0800 Subject: [PATCH] make the group foldable --- scripts/developer/utilities/lib/prop/PropGroup.qml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/scripts/developer/utilities/lib/prop/PropGroup.qml b/scripts/developer/utilities/lib/prop/PropGroup.qml index 7b901b079d..0b8d5621f4 100644 --- a/scripts/developer/utilities/lib/prop/PropGroup.qml +++ b/scripts/developer/utilities/lib/prop/PropGroup.qml @@ -25,6 +25,8 @@ Item { property var label: "group" + property var isUnfold: false + Item { id: header height: global.slimHeight @@ -39,6 +41,7 @@ Item { text: root.label horizontalAlignment: Text.AlignHCenter } + Rectangle { id: headerRect color: global.color @@ -50,11 +53,20 @@ Item { anchors.right: header.right anchors.verticalCenter: header.verticalCenter height: parent.height + + MouseArea{ + id: mousearea + anchors.fill: parent + onDoubleClicked: { + root.isUnfold = !root.isUnfold + } + } } } Column { id: column + visible: root.isUnfold anchors.top: header.bottom anchors.left: parent.left anchors.right: parent.right @@ -62,7 +74,7 @@ Item { // Where the propItems are added } - height: header.height + column.height + height: header.height + isUnfold * column.height function updatePropItems() { for (var i = 0; i < root.propItems.length; i++) {