mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 19:14:59 +02:00
make the group foldable
This commit is contained in:
parent
f7896b6407
commit
5b8116bec4
1 changed files with 13 additions and 1 deletions
|
@ -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++) {
|
||||
|
|
Loading…
Reference in a new issue