summaryrefslogtreecommitdiffstats
path: root/examples/declarative/border-image/MyBorderImage.qml
blob: 395b648bbaa826c6250c6607196627c1a331d9d2 (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
import Qt 4.6

Item {
    property var horizontalMode : BorderImage.Stretch
    property var verticalMode : BorderImage.Stretch
    property alias source: MyImage.source
    property int minWidth
    property int minHeight
    property int maxWidth
    property int maxHeight
    property int margin

    id: Container
    width: 240; height: 240
    BorderImage {
        id: MyImage; x: Container.width / 2 - width / 2; y: Container.height / 2 - height / 2

        width: SequentialAnimation {
            running: true; repeat: true
            NumberAnimation { from: Container.minWidth; to: Container.maxWidth; duration: 2000; easing: "easeInOutQuad"}
            NumberAnimation { from: Container.maxWidth; to: Container.minWidth; duration: 2000; easing: "easeInOutQuad" }
        }

        height: SequentialAnimation {
            running: true; repeat: true
            NumberAnimation { from: Container.minHeight; to: Container.maxHeight; duration: 2000; easing: "easeInOutQuad"}
            NumberAnimation { from: Container.maxHeight; to: Container.minHeight; duration: 2000; easing: "easeInOutQuad" }
        }

        horizontalTileMode: Container.horizontalMode
        verticalTileMode: Container.verticalMode
        border.top: Container.margin
        border.left: Container.margin
        border.bottom: Container.margin
        border.right: Container.margin
    }
}