aboutsummaryrefslogtreecommitdiffstats
path: root/tests/manual/scenegraph_lancelot/data/rectangles/test-rectangles.qml
blob: 0eb0a37de80e405c172a0ec72455a2eaa77e14b8 (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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import QtQuick 2.0

Rectangle {
    width: 320
    height: 480
    Column {
        id: foo
        x: -width * (scale - 1) * (10/9) * (mouseArea.mouseX / width - 0.5)
        y: -height * (scale - 1) * (10/9) * (mouseArea.mouseY / height - 0.5)
        states: [
            State {
                name: ""
                PropertyChanges {
                    target: foo
                    scale: 1
                }
            },
            State {
                name: "zoomed"
                when: mouseArea.pressed
                PropertyChanges {
                    target: foo
                    scale: 10
                }
            }
        ]
        Behavior on scale {
            NumberAnimation { duration: 300; easing.type: Easing.InOutSine }
        }

        Repeater {
            model: 3
            Row {
                id: local
                property int _index: index
                Repeater {
                    model: 2
                    Item {
                        width: 80
                        height: 160
                        Rectangle {
                            anchors.fill: parent
                            anchors.margins: 10
                            radius: index * 20
                            border.pixelAligned: local._index == 1
                            border.width: local._index == 0 ? 0 : 0.5
                            opacity: 0.5
                            color: "steelBlue"
                        }
                    }
                }
                Repeater {
                    model: 2
                    Item {
                        width: 80
                        height: 160
                        Rectangle {
                            anchors.fill: parent
                            anchors.margins: 10
                            radius: index * 20
                            border.pixelAligned: local._index == 1
                            border.width: local._index == 0 ? 0 : 0.5
                            opacity: 0.5
                            gradient: Gradient {
                                GradientStop { position: 0.05; color: "lightsteelblue" }
                                GradientStop { position: 0.1; color: "lightskyblue" }
                                GradientStop { position: 0.5; color: "skyblue" }
                                GradientStop { position: 0.9; color: "deepskyblue" }
                                GradientStop { position: 0.95; color: "dodgerblue" }
                            }
                        }
                    }
                }
            }
        }
    }
    MouseArea {
        id: mouseArea
        anchors.fill: parent
    }
}