Warning, /education/gcompris/src/activities/left_right_click/MouseButton.qml is written in an unsupported language. File is not indexed.

0001 /* GCompris - MouseButton.qml
0002  *
0003  * SPDX-FileCopyrightText: 2022 Samarth Raj <mailforsamarth@gmail.com>
0004  * SPDX-FileCopyrightText: 2022 Timothée Giet <animtim@gmail.com>
0005  * SPDX-License-Identifier: GPL-3.0-or-later
0006  */
0007 import QtQuick 2.12
0008 import GCompris 1.0
0009 
0010 Image {
0011     id: mouseButton
0012     property bool isRightButton: false
0013     source: "qrc:/gcompris/src/activities/left_right_click/resource/mouse_button.svg"
0014     width: parent.width
0015     height: parent.height
0016     sourceSize.width: parent.sourceSize.width
0017     anchors.centerIn: parent
0018     fillMode: Image.PreserveAspectFit
0019     opacity: 0
0020     mirror: mouseButton.isRightButton
0021 
0022     SequentialAnimation {
0023         id: runCodeClickAnimation
0024         NumberAnimation { target: mouseButton; property: "scale"; to: 0.9; duration: 100 }
0025         NumberAnimation { target: mouseButton; property: "scale"; to: 1.0; duration: 100 }
0026     }
0027     PropertyAnimation {
0028         id: changeToInitialColor
0029         target: mouseButton
0030         property: "opacity"
0031         to: 0
0032         duration: 1000
0033     }
0034 
0035     signal clickTrigger
0036     onClickTrigger: {
0037         mouseButton.opacity = 1
0038         runCodeClickAnimation.running = true
0039         changeToInitialColor.running = true
0040     }
0041 }