Warning, /education/gcompris/src/activities/tens_complement_swap/Card.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - Card.qml
0002 *
0003 * SPDX-FileCopyrightText: 2022 Samarth Raj <mailforsamarth@gmail.com>
0004 * SPDX-License-Identifier: GPL-3.0-or-later
0005 */
0006 import QtQuick 2.12
0007 import "../../core"
0008 import "tens_complement_swap.js" as Activity
0009
0010 Item {
0011 Rectangle {
0012 color: type == "numberCard" ? "white" : "transparent"
0013 height: items.isHorizontal ? (selected ? parent.height : parent.height * 0.8) :
0014 (selected || type == "symbolCard" ? parent.height : parent.height * 0.8)
0015 width: items.isHorizontal ? (selected ? parent.width : parent.width * 0.9) :
0016 (selected || type == "symbolCard" ? parent.width : parent.width * 0.9)
0017 border.width: selected ? 12 : 3
0018 border.color: type == "numberCard" ? "#9FB8E3" : "transparent"
0019 radius: 15
0020 anchors.centerIn: parent
0021
0022 GCText {
0023 width: parent.width
0024 height: parent.height
0025 anchors.centerIn: parent
0026 color: "#373737"
0027 text: value
0028 wrapMode: Text.WordWrap
0029 fontSizeMode: Text.Fit
0030 font.pointSize: Math.max(1, parent.width) // QFont::setPointSizeF: must be greater than 0.
0031 verticalAlignment: Text.AlignVCenter
0032 horizontalAlignment: Text.AlignHCenter
0033 }
0034 }
0035 MouseArea {
0036 anchors.fill: parent
0037 enabled: selectable && !Activity.items.bonus.isPlaying
0038 onClicked: {
0039 selected = true;
0040 Activity.selectCard({ columnNumber: index, rowNumber: rowNumber })
0041 }
0042 }
0043 }
0044