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

0001 /* GCompris - FractionNumber.qml
0002  *
0003  * SPDX-FileCopyrightText: 2022 Johnny Jazeix <jazeix@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 import "../../core"
0011 
0012 Item {
0013     id: fractionNumber
0014     property int value: 0
0015     signal leftClicked
0016     signal rightClicked
0017 
0018     property bool interactive: true
0019 
0020     Image {
0021         id: shiftKeyboardLeft
0022         source: "qrc:/gcompris/src/core/resource/bar_previous.svg"
0023         height: 25 * ApplicationInfo.ratio
0024         width: height
0025         sourceSize.height: height
0026         enabled: fractionNumber.interactive && !items.buttonsBlocked
0027         opacity: fractionNumber.interactive ? 1 : 0
0028         fillMode: Image.PreserveAspectFit
0029         anchors.left: parent.left
0030         anchors.verticalCenter: parent.verticalCenter
0031         MouseArea {
0032             enabled: true
0033             anchors.centerIn: parent
0034             width: parent.width * 1.5
0035             height: width
0036             onClicked: {
0037                 leftClicked();
0038             }
0039         }
0040     }
0041     Item {
0042         z: 10
0043         height: fractionNumber.height
0044         width: shiftKeyboardLeft.width
0045         anchors.centerIn: parent
0046         GCText {
0047             id: valueText
0048             text: "" + value
0049             font.weight: Font.DemiBold
0050             anchors.centerIn: parent
0051             color: "white"
0052         }
0053     }
0054     Image {
0055         id: shiftKeyboardRight
0056         source: "qrc:/gcompris/src/core/resource/bar_next.svg"
0057         height: shiftKeyboardLeft.height
0058         width: height
0059         sourceSize.height: height
0060         enabled: fractionNumber.interactive && !items.buttonsBlocked
0061         opacity: fractionNumber.interactive ? 1 : 0
0062         fillMode: Image.PreserveAspectFit
0063         anchors.right: parent.right
0064         anchors.verticalCenter: parent.verticalCenter
0065         MouseArea {
0066             enabled: true
0067             anchors.centerIn: parent
0068             width: parent.width * 1.5
0069             height: width
0070             onClicked: {
0071                 rightClicked();
0072             }
0073         }
0074     }
0075 }