diff options
Diffstat (limited to 'widgets/StyledRect.qml')
| -rw-r--r-- | widgets/StyledRect.qml | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/widgets/StyledRect.qml b/widgets/StyledRect.qml new file mode 100644 index 0000000..f9d6ad1 --- /dev/null +++ b/widgets/StyledRect.qml @@ -0,0 +1,41 @@ +import "root:/config" +import QtQuick + +Rectangle { + id: root + + property bool animated: false + property bool vertical: false // Convenience property for propagation to children + + color: "transparent" + implicitWidth: childrenRect.width + implicitHeight: childrenRect.height + + Behavior on color { + ColorAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.standard + } + } + + Behavior on implicitWidth { + enabled: root.animated + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } + + Behavior on implicitHeight { + enabled: root.animated + + NumberAnimation { + duration: Appearance.anim.durations.normal + easing.type: Easing.BezierSpline + easing.bezierCurve: Appearance.anim.curves.emphasized + } + } +} |