Warning, /education/gcompris/src/core/GCButtonCancel.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - GCButtonCancel.qml
0002 *
0003 * SPDX-FileCopyrightText: 2015 Bruno Coudoin <bruno.coudoin@gcompris.net>
0004 *
0005 * Authors:
0006 * Bruno Coudoin <bruno.coudoin@gcompris.net>
0007 *
0008 * SPDX-License-Identifier: GPL-3.0-or-later
0009 */
0010 import QtQuick 2.12
0011 import GCompris 1.0
0012
0013 /**
0014 * A QML component representing GCompris' cancel button.
0015 * @ingroup components
0016 *
0017 * @inherit QtQuick.Image
0018 */
0019 Image {
0020 id: cancel
0021 source: apply ? "qrc:/gcompris/src/core/resource/apply.svg" : "qrc:/gcompris/src/core/resource/cancel.svg";
0022 anchors.right: parent.right
0023 anchors.top: parent.top
0024 smooth: true
0025 sourceSize.width: 60 * ApplicationInfo.ratio
0026 fillMode: Image.PreserveAspectFit
0027 anchors.margins: 10
0028
0029 signal close
0030
0031 property bool apply: false
0032
0033 SequentialAnimation {
0034 id: anim
0035 running: true
0036 loops: Animation.Infinite
0037 NumberAnimation {
0038 target: cancel
0039 property: "rotation"
0040 from: -10; to: 10
0041 duration: 500
0042 easing.type: Easing.InOutQuad
0043 }
0044 NumberAnimation {
0045 target: cancel
0046 property: "rotation"
0047 from: 10; to: -10
0048 duration: 500
0049 easing.type: Easing.InOutQuad }
0050 }
0051 MouseArea {
0052 anchors.fill: parent
0053 onClicked: close()
0054 }
0055 }