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

0001 /* GCompris - arrow.qml
0002  *
0003  * SPDX-FileCopyrightText: 2014 Bruno coudoin <bruno.coudoin@gcompris.net>
0004  *
0005  * Authors:
0006  *   Bruno Coudoin <bruno.coudoin@gcompris.net> (GTK+ version)
0007  *   Bruno Coudoin <bruno.coudoin@gcompris.net> (Qt Quick port)
0008  *
0009  *   SPDX-License-Identifier: GPL-3.0-or-later
0010  */
0011 import QtQuick 2.12
0012 import GCompris 1.0
0013 
0014 import "../../core"
0015 import "target.js" as Activity
0016 
0017 Repeater {
0018     id: arrowRepeater
0019     model: 0
0020     
0021     signal init(int nbArrow)
0022     
0023     onInit: {
0024         // Set to 0 to force a delete of previous arrows
0025         model = 0
0026         model = nbArrow
0027         items.currentArrow = 0
0028     }
0029     
0030     Rectangle {
0031         id: arrow
0032         width: 15 * ApplicationInfo.ratio
0033         height: 15 * ApplicationInfo.ratio
0034         radius: width / 2
0035         anchors.centerIn: parent
0036         border.width: 1 * ApplicationInfo.ratio
0037         border.color: "#60000000"
0038         opacity: 0
0039         color: "#d6d6d6"
0040         scale: 2
0041         
0042         Behavior on scale {
0043             id: scale
0044             NumberAnimation {
0045                 id: anim
0046                 duration: 1000
0047                 easing.type: Easing.InOutQuad
0048                 onRunningChanged: {
0049                     if(!anim.running) {
0050                         // Reparent the arrow on the target
0051                         targetItem.attachArrow(arrow)
0052                     }
0053                 }
0054             }
0055         }
0056     }
0057 }