summaryrefslogtreecommitdiffstats
path: root/resources/example.qml
blob: aaea0286d3d8c55fe29f02ba5beb6e450a9437b9 (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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
import Qt 4.7

Item {
    id: item1
    width: 1024
    height: 768
    clip: true

    Item {
        id: camerawrapper
        property real yaw: 0
        property real pitch: 0
        property real zoom: 1

        onYawChanged: Camera.yaw = yaw
        onPitchChanged: Camera.pitch = pitch
        onZoomChanged: Camera.zoom = zoom

        Behavior on yaw { NumberAnimation{ } }
        Behavior on pitch { NumberAnimation{ } }
        Behavior on zoom { NumberAnimation{ } }
    }

    Rectangle {
        id: rectangle1
        width: 139
        height: 212
        radius: 15
        gradient: Gradient {
            GradientStop {
                id: gradientstop3
                position: 0
                color: "#6f6f6f"
            }

            GradientStop {
                id: gradientstop4
                position: 0.27
                color: "#141414"
            }

            GradientStop {
                id: gradientstop5
                position: 1
                color: "#50000000"
            }
        }
        anchors.left: rectangle2.left
        anchors.leftMargin: -5
        anchors.top: rectangle2.bottom
        anchors.topMargin: 6
        z: 0
        border.width: 4
        border.color: "#1a1a1a"
        clip: false

        Behavior on opacity { PropertyAnimation { } }

        Image {
            id: image1
            width: 135
            height: 31
            anchors.top: parent.top
            anchors.topMargin: 9
            anchors.right: parent.right
            anchors.rightMargin: 0
            anchors.left: parent.left
            anchors.leftMargin: 0
            fillMode: "PreserveAspectFit"
            smooth: true
            source: "qt-logo.png"
        }

        Rectangle {
            id: rectangle3
            x: 89
            y: 95
            width: 24
            height: 26
            color: "#ffffff"

            MouseArea {
                id: mouse_area1
                anchors.fill: parent

                onPressed: camerawrapper.yaw += 20
            }
        }

        Rectangle {
            id: rectangle4
            x: 27
            y: 95
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area2
                anchors.fill: parent

                onPressed: camerawrapper.yaw -= 20
            }
        }

        Rectangle {
            id: rectangle5
            x: 58
            y: 64
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area3
                anchors.fill: parent

                onPressed: camerawrapper.pitch -= 20
            }
        }

        Rectangle {
            id: rectangle6
            x: 58
            y: 126
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area4
                x: 0
                y: -1
                anchors.rightMargin: 0
                anchors.bottomMargin: 0
                anchors.leftMargin: 0
                anchors.topMargin: 0
                anchors.fill: parent

                onPressed: camerawrapper.pitch += 20
            }
        }

        Rectangle {
            id: rectangle9
            x: 89
            y: 171
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area7
                x: 0
                y: 0
                anchors.fill: parent
                anchors.topMargin: 0
                anchors.rightMargin: 0
                anchors.bottomMargin: 0
                anchors.leftMargin: 0

                onPressed: camerawrapper.zoom *= 1.3
            }
        }

        Rectangle {
            id: rectangle7
            x: 58
            y: 95
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area5
                x: 0
                y: -1
                anchors.fill: parent
                anchors.topMargin: 0
                anchors.rightMargin: 0
                anchors.bottomMargin: 0
                anchors.leftMargin: 0

                onClicked: { camerawrapper.yaw = 0; camerawrapper.pitch = 0 }
            }
        }

        Rectangle {
            id: rectangle8
            x: 27
            y: 171
            width: 24
            height: 26
            color: "#ffffff"
            MouseArea {
                id: mouse_area6
                x: 0
                y: -1
                anchors.fill: parent
                anchors.topMargin: 0
                anchors.rightMargin: 0
                anchors.bottomMargin: 0
                anchors.leftMargin: 0

                onPressed: camerawrapper.zoom /= 1.3
            }
        }
    }

    Rectangle {
        id: rectangle2
        x: 31
        y: 269
        width: 25
        height: 25
        radius: 5
        gradient: Gradient {
            GradientStop {
                position: 0
                color: "#c83e3e3e"
            }

            GradientStop {
                position: 1
                color: "#c8919191"
            }
        }

        border.width: 2
        border.color: "#1a1a1a"
        z: -1

        Image {
            id: image2
            anchors.rightMargin: 5
            anchors.leftMargin: 5
            anchors.bottomMargin: 5
            anchors.topMargin: 5
            anchors.fill: parent
            smooth: true
            fillMode: "Stretch"
            source: "move.gif"
        }

        MouseArea {
            anchors.fill: parent
            drag.target: rectangle2
            drag.axis: "XandYAxis"
            drag.minimumX: 0
            drag.minimumY: 0
            drag.maximumX: item1.width - rectangle2.width
            drag.maximumY: item1.height - rectangle2.height
        }
    }

    Rectangle {
        id: rectangle10
        width: 25
        radius: 5
        gradient: Gradient {
            GradientStop {
                id: gradientstop1
                position: 0
                color: "#c83e3e3e"
            }

            GradientStop {
                id: gradientstop2
                position: 1
                color: "#c8919191"
            }
        }
        anchors.left: rectangle2.right
        anchors.leftMargin: 6
        anchors.top: rectangle2.top
        anchors.bottom: rectangle2.bottom
        border.color: "#1a1a1a"

        MouseArea {
            anchors.fill: parent
            drag.minimumY: 0
            drag.axis: "XandYAxis"
            drag.minimumX: 0
            drag.target: rectangle10
            drag.maximumY: item1.height - rectangle10.height
            drag.maximumX: item1.width - rectangle10.width

            onClicked: item1.state = item1.state == '' ? 'State1' : ''
        }

        Rectangle {
            id: rectangle11
            x: 0
            y: -2
            radius: 12
            gradient: Gradient {
                GradientStop {
                    position: 0
                    color: "#5a5a5a"
                }

                GradientStop {
                    position: 1
                    color: "#000000"
                }
            }
            rotation: -35
            anchors.rightMargin: 6
            anchors.bottomMargin: 6
            anchors.leftMargin: 6
            anchors.topMargin: 6
            anchors.fill: parent
        }
        border.width: 2
        z: -1
    }
    states: [
        State {
            name: "State1"

            PropertyChanges {
                target: rectangle1
                opacity: 0
            }
        }
    ]
}