Commit 71bce2f4 authored by Aleksei German's avatar Aleksei German

Watch Demo Dummy Widget logic & ui separation

parent 2be4c0aa
/******************************************************************************
**
** Copyright (C) 2019 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Quick Ultralite module.
**
** $QT_BEGIN_LICENSE:COMM$
**
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or, alternatively, in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** $QT_END_LICENSE$
**
******************************************************************************/
import QtQuick 2.12
DummyWidget {
id: root
readonly property int introAnimationDuration: 100
onVisibleChanged: {
introAnimation.running = visible
if (!visible) {
root.state = "default"
}
}
SequentialAnimation {
id: introAnimation
running: root.visible
NumberAnimation { target: root; property: "outerRingOpacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: root; property: "innerRingOpacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: root; property: "centerRingOpacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: root; property: "dummyTextOpacity"; to: 1.0; duration: introAnimationDuration }
PropertyAction { target: root; property: "state"; value: "running" }
}
MouseArea {
anchors.fill: parent
onClicked: MainModel.dummyOn = false
}
}
......@@ -22,40 +22,17 @@
import QtQuick 2.12
Rectangle {
id: dummy_root
id: root
height: Theme.appHeight
width: Theme.appWidth
color: Theme.backgroundColor
readonly property real startOpacity: 0.0
readonly property int introAnimationDuration: 100
readonly property int degreeBaseDuration: 3000
readonly property int offset: 180
onVisibleChanged: {
introAnimation.running = visible
if (!visible) {
dummy_root.state = "default"
}
}
SequentialAnimation {
id: introAnimation
running: dummy_root.visible
NumberAnimation { target: outerRing; property: "opacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: innerRing; property: "opacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: centerRing; property: "opacity"; to: 1.0; duration: introAnimationDuration }
NumberAnimation { target: dummyText; property: "opacity"; to: 1.0; duration: introAnimationDuration }
PropertyAction { target: dummy_root; property: "state"; value: "running" }
}
MouseArea {
anchors.fill: parent
onClicked: MainModel.dummyOn = false
}
property alias outerRingOpacity: outerRing.opacity
property alias innerRingOpacity: innerRing.opacity
property alias centerRingOpacity: centerRing.opacity
property alias dummyTextOpacity: dummyText.opacity
Image {
id: centerRing
......
......@@ -45,7 +45,7 @@ Rectangle {
visible: MainModel.compassOn
}
DummyWidget {
DummyController {
visible: MainModel.dummyOn
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment