Warning, /education/gcompris/src/activities/algebra_plus/ActivityConfig.qml is written in an unsupported language. File is not indexed.
0001 /* GCompris - ActivityConfig.qml 0002 * 0003 * SPDX-FileCopyrightText: 2020 Johnny Jazeix <jazeix@gmail.com> 0004 * 0005 * Authors: 0006 * Johnny Jazeix <jazeix@gmail.com> 0007 * 0008 * SPDX-License-Identifier: GPL-3.0-or-later 0009 */ 0010 import QtQuick 2.12 0011 import GCompris 1.0 0012 0013 import "../../core" 0014 0015 Item { 0016 id: activityConfiguration 0017 property Item background 0018 property alias speedSlider: speedSlider 0019 property int speedSetting: 5 0020 width: flick.width 0021 0022 Column { 0023 spacing: 10 * ApplicationInfo.ratio 0024 width: activityConfiguration.width 0025 GCText { 0026 id: speedSliderText 0027 text: qsTr("Speed") 0028 width: parent.width 0029 fontSize: mediumSize 0030 wrapMode: Text.WordWrap 0031 } 0032 GCSlider { 0033 id: speedSlider 0034 width: 250 * ApplicationInfo.ratio 0035 value: speedSetting 0036 to: 5 0037 from: 1 0038 wheelEnabled: false 0039 } 0040 } 0041 0042 property var dataToSave 0043 function setDefaultValues() { 0044 speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) 0045 if(dataToSave.speedSetting) { 0046 activityConfiguration.speedSetting = dataToSave.speedSetting 0047 } 0048 else { 0049 activityConfiguration.speedSetting = 5 0050 } 0051 } 0052 function saveValues() { 0053 speedSetting = speedSlider.value 0054 dataToSave = {"speedSetting": speedSetting} 0055 } 0056 }