diff options
Diffstat (limited to 'modules/utilities/Wrapper.qml')
| -rw-r--r-- | modules/utilities/Wrapper.qml | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/modules/utilities/Wrapper.qml b/modules/utilities/Wrapper.qml new file mode 100644 index 0000000..3d1d50a --- /dev/null +++ b/modules/utilities/Wrapper.qml @@ -0,0 +1,52 @@ +import "root:/config" +import QtQuick + +Item { + id: root + + required property bool visibility + + visible: height > 0 + implicitHeight: 0 + implicitWidth: content.implicitWidth + + states: State { + name: "visible" + when: root.visibility + + PropertyChanges { + root.implicitHeight: content.implicitHeight + } + } + + transitions: [ + Transition { + from: "" + to: "visible" + + NumberAnimation { + target: root + property: "implicitHeight" + duration: Appearance.anim.durations.expressiveDefaultSpatial + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.expressiveDefaultSpatial + } + }, + Transition { + from: "visible" + to: "" + + NumberAnimation { + target: root + property: "implicitHeight" + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + ] + + Content { + id: content + } +} |