Warning, /education/gcompris/src/core/GCDialogCheckBox.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - GCDialogCheckBox.qml
0002 *
0003 * SPDX-FileCopyrightText: 2014 Bruno Coudoin <bruno.coudoin@gcompris.net>
0004 *
0005 * Authors:
0006 * Bruno Coudoin <bruno.coudoin@gcompris.net>
0007 *
0008 * SPDX-License-Identifier: GPL-3.0-or-later
0009 */
0010 import QtQuick 2.12
0011 import QtQuick.Controls 2.12
0012 import GCompris 1.0
0013
0014 /**
0015 * GCompris' CheckBox component.
0016 * @ingroup components
0017 *
0018 * @inherit QtQuick.Controls2.CheckBox
0019 */
0020 CheckBox {
0021 id: checkBox
0022 width: parent.width
0023
0024 /**
0025 * type:int
0026 * Font size of the label text.
0027 * By default it is set to 16 i.e. GCText.mediumSize
0028 *
0029 */
0030 property int labelTextFontSize: 16
0031 /**
0032 * type:int
0033 * Height of the indicator image.
0034 */
0035 property int indicatorImageHeight: 50 * ApplicationInfo.ratio
0036
0037 focusPolicy: Qt.NoFocus
0038
0039 indicator: Image {
0040 sourceSize.height: checkBox.indicatorImageHeight
0041 property string suffix: checkBox.enabled ? ".svg" : "_disabled.svg"
0042 source:
0043 checkBox.checked ? "qrc:/gcompris/src/core/resource/apply" + suffix :
0044 "qrc:/gcompris/src/core/resource/cancel" + suffix
0045 }
0046 contentItem: GCText {
0047 anchors.left: indicator.right
0048 anchors.leftMargin: 10
0049 anchors.right: checkBox.right
0050 fontSize: labelTextFontSize
0051 text: checkBox.text
0052 wrapMode: Text.WordWrap
0053 }
0054 }