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

0001 /* GCompris - Message.qml
0002  *
0003  * SPDX-FileCopyrightText: 2014 Bruno Coudoin <bruno.coudoin@gcompris.net>
0004  *
0005  * Authors:
0006  *   Bruno Coudoin <bruno.coudoin@gcompris.net> (Qt Quick port)
0007  *
0008  *   SPDX-License-Identifier: GPL-3.0-or-later
0009  */
0010 import QtQuick 2.12
0011 
0012 import "../../core"
0013 
0014 Item {
0015     id: message
0016 
0017     property alias text: messageText.text
0018     property bool displayed: messageText.text != "" ? true : false
0019 
0020     Rectangle {
0021         id: messageBg
0022         x: messageText.x - 4
0023         y: messageText.y - 4
0024         width: messageText.width + 8
0025         height: messageText.height + 8
0026         color: "#ddd6e598"
0027         border.color: "black"
0028         border.width: 2
0029         radius: 8
0030         opacity: message.displayed ? 1 : 0
0031 
0032         MouseArea {
0033             anchors.fill: parent
0034             onClicked: message.text = ""
0035         }
0036         Behavior on opacity { NumberAnimation { duration: 100 } }
0037     }
0038     
0039     GCText {
0040         id: messageText
0041         anchors {
0042             top: parent.top
0043             right: parent.right
0044             left: parent.left
0045         }
0046         color: "black"
0047         fontSize: 18
0048         horizontalAlignment: Text.AlignHCenter
0049         verticalAlignment: Text.AlignVCenter
0050         wrapMode: TextEdit.WordWrap
0051         opacity: message.displayed ? 1 : 0
0052         Behavior on opacity { NumberAnimation { duration: 100 } }
0053     }
0054 }