2020-12-15 01:16:49 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
|
|
|
|
import "." as Opaque
|
|
|
|
import "theme"
|
|
|
|
|
|
|
|
Opaque.Column {
|
|
|
|
id: root
|
|
|
|
|
2020-12-17 01:34:15 +00:00
|
|
|
//: Show
|
2020-12-15 01:16:49 +00:00
|
|
|
readonly property string strShow: qsTr("collapser-show")
|
2020-12-17 01:34:15 +00:00
|
|
|
//: Hide
|
2020-12-15 01:16:49 +00:00
|
|
|
readonly property string strHide: qsTr("collapser-hide")
|
|
|
|
|
|
|
|
property string textShow: strShow
|
|
|
|
property string textHide: strHide
|
|
|
|
property bool expanded: false
|
|
|
|
|
|
|
|
height: expanded ? childrenRect.height + 2 * root.padding : lblTitle.height + root.padding + root.spacing
|
|
|
|
Behavior on height { PropertyAnimation {} }
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
Opaque.Label {
|
|
|
|
id: lblTitle
|
|
|
|
text: root.expanded ? root.textHide + " ▲" : root.textShow + " ▼"
|
|
|
|
header: true
|
|
|
|
MouseArea {
|
|
|
|
anchors.fill: parent
|
|
|
|
onClicked: root.expanded = !root.expanded
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|