Warning, /education/gcompris/src/activities/note_names/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             width: parent.width
0028             text: qsTr("Speed")
0029             fontSize: mediumSize
0030             wrapMode: Text.WordWrap
0031         }
0032         GCSlider {
0033             id: speedSlider
0034             width: 250 * ApplicationInfo.ratio
0035             value: speedSetting
0036             from: 1
0037             to: 5
0038             wheelEnabled: false
0039         }
0040     }
0041 
0042     property var dataToSave
0043     function setDefaultValues() {
0044         // Recreate the binding
0045         speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;})
0046         if(dataToSave.speedSetting) {
0047             activityConfiguration.speedSetting = dataToSave.speedSetting
0048         }
0049         else {
0050             activityConfiguration.speedSetting = 5
0051         }
0052     }
0053 
0054     function saveValues() {
0055         dataToSave = {"speedSetting": speedSlider.value}
0056     }
0057 }