2022-08-19 15:59:36 +02:00
|
|
|
// Copyright (C) 2021 The Qt Company Ltd.
|
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2021-09-23 09:21:13 +02:00
|
|
|
|
2021-10-21 16:36:09 +02:00
|
|
|
import QtQuick
|
2021-09-23 09:21:13 +02:00
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: page
|
2021-10-21 16:36:09 +02:00
|
|
|
anchors.fill: parent
|
|
|
|
|
color: "#ffffff"
|
2021-09-23 09:21:13 +02:00
|
|
|
|
|
|
|
|
Image {
|
|
|
|
|
id: icon
|
|
|
|
|
x: 20
|
|
|
|
|
y: 20
|
2021-10-21 16:36:09 +02:00
|
|
|
source: "qt-logo.png"
|
2021-09-23 09:21:13 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: topLeftRect
|
|
|
|
|
width: 55
|
|
|
|
|
height: 41
|
|
|
|
|
color: "#00ffffff"
|
|
|
|
|
border.color: "#808080"
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.top: parent.top
|
|
|
|
|
anchors.leftMargin: 20
|
|
|
|
|
anchors.topMargin: 20
|
|
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: mouseArea
|
|
|
|
|
function onClicked()
|
|
|
|
|
{
|
|
|
|
|
page.state = "State1"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: middleRightRect
|
|
|
|
|
width: 55
|
|
|
|
|
height: 41
|
|
|
|
|
color: "#00ffffff"
|
|
|
|
|
border.color: "#808080"
|
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
anchors.right: parent.right
|
|
|
|
|
anchors.rightMargin: 20
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea1
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: mouseArea1
|
|
|
|
|
function onClicked()
|
|
|
|
|
{
|
|
|
|
|
page.state = "State2"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Rectangle {
|
|
|
|
|
id: bottomLeftRect
|
|
|
|
|
width: 55
|
|
|
|
|
height: 41
|
|
|
|
|
color: "#00ffffff"
|
|
|
|
|
border.color: "#808080"
|
|
|
|
|
anchors.left: parent.left
|
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
|
anchors.bottomMargin: 20
|
|
|
|
|
anchors.leftMargin: 20
|
|
|
|
|
MouseArea {
|
|
|
|
|
id: mouseArea2
|
|
|
|
|
anchors.fill: parent
|
|
|
|
|
|
|
|
|
|
Connections {
|
|
|
|
|
target: mouseArea2
|
|
|
|
|
function onClicked()
|
|
|
|
|
{
|
|
|
|
|
page.state = "State3"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
states: [
|
|
|
|
|
State {
|
|
|
|
|
name: "State1"
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "State2"
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: icon
|
|
|
|
|
x: middleRightRect.x
|
|
|
|
|
y: middleRightRect.y
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
State {
|
|
|
|
|
name: "State3"
|
|
|
|
|
|
|
|
|
|
PropertyChanges {
|
|
|
|
|
target: icon
|
|
|
|
|
x: bottomLeftRect.x
|
|
|
|
|
y: bottomLeftRect.y
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
2021-10-21 16:36:09 +02:00
|
|
|
|
2021-09-23 09:21:13 +02:00
|
|
|
transitions: [
|
|
|
|
|
Transition {
|
|
|
|
|
id: toState1
|
|
|
|
|
ParallelAnimation {
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "y"
|
|
|
|
|
duration: 200
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "x"
|
|
|
|
|
duration: 200
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
to: "State1"
|
|
|
|
|
from: "State2,State3"
|
|
|
|
|
},
|
|
|
|
|
Transition {
|
|
|
|
|
id: toState2
|
|
|
|
|
ParallelAnimation {
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "y"
|
2021-10-21 16:36:09 +02:00
|
|
|
easing.type: Easing.OutBounce
|
2021-09-23 09:21:13 +02:00
|
|
|
duration: 1006
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "x"
|
2021-10-21 16:36:09 +02:00
|
|
|
easing.type: Easing.OutBounce
|
2021-09-23 09:21:13 +02:00
|
|
|
duration: 1006
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
to: "State2"
|
|
|
|
|
from: "State1,State3"
|
|
|
|
|
},
|
|
|
|
|
Transition {
|
|
|
|
|
id: toState3
|
|
|
|
|
ParallelAnimation {
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "y"
|
2021-10-21 16:36:09 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
2021-09-23 09:21:13 +02:00
|
|
|
duration: 2000
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SequentialAnimation {
|
|
|
|
|
PauseAnimation {
|
|
|
|
|
duration: 0
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
PropertyAnimation {
|
|
|
|
|
target: icon
|
|
|
|
|
property: "x"
|
2021-10-21 16:36:09 +02:00
|
|
|
easing.type: Easing.InOutQuad
|
2021-09-23 09:21:13 +02:00
|
|
|
duration: 2000
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
to: "State3"
|
|
|
|
|
from: "State1,State2"
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|