summaryrefslogtreecommitdiff
path: root/widgets/StyledRect.qml
blob: 07c1e77eec3d8e07d2d516a53a70820953221c44 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
import "root:/config"
import QtQuick

Rectangle {
    id: root

    property bool animate: 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.animate

        NumberAnimation {
            duration: Appearance.anim.durations.normal
            easing.type: Easing.BezierSpline
            easing.bezierCurve: Appearance.anim.curves.emphasized
        }
    }

    Behavior on implicitHeight {
        enabled: root.animate

        NumberAnimation {
            duration: Appearance.anim.durations.normal
            easing.type: Easing.BezierSpline
            easing.bezierCurve: Appearance.anim.curves.emphasized
        }
    }
}