diff --git a/src/activities/algebra_by/ActivityConfig.qml b/src/activities/algebra_by/ActivityConfig.qml index da5252166..334a20746 100644 --- a/src/activities/algebra_by/ActivityConfig.qml +++ b/src/activities/algebra_by/ActivityConfig.qml @@ -1,70 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 5 width: if(background) background.width - Flow { - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 5 - minimumValue: 1 - scrollEnabled: false - } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 5 + minimumValue: 1 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 5 } } function saveValues() { speedSetting = speedSlider.value dataToSave = {"speedSetting": speedSetting} } } diff --git a/src/activities/algebra_div/ActivityConfig.qml b/src/activities/algebra_div/ActivityConfig.qml index da5252166..334a20746 100644 --- a/src/activities/algebra_div/ActivityConfig.qml +++ b/src/activities/algebra_div/ActivityConfig.qml @@ -1,70 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 5 width: if(background) background.width - Flow { - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 5 - minimumValue: 1 - scrollEnabled: false - } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 5 + minimumValue: 1 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 5 } } function saveValues() { speedSetting = speedSlider.value dataToSave = {"speedSetting": speedSetting} } } diff --git a/src/activities/algebra_minus/ActivityConfig.qml b/src/activities/algebra_minus/ActivityConfig.qml index 1525d8d20..334a20746 100644 --- a/src/activities/algebra_minus/ActivityConfig.qml +++ b/src/activities/algebra_minus/ActivityConfig.qml @@ -1,71 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 5 width: if(background) background.width - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 5 - minimumValue: 1 - scrollEnabled: false - } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 5 + minimumValue: 1 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 5 } } function saveValues() { speedSetting = speedSlider.value dataToSave = {"speedSetting": speedSetting} } } diff --git a/src/activities/algebra_plus/ActivityConfig.qml b/src/activities/algebra_plus/ActivityConfig.qml index 1525d8d20..334a20746 100644 --- a/src/activities/algebra_plus/ActivityConfig.qml +++ b/src/activities/algebra_plus/ActivityConfig.qml @@ -1,71 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 5 width: if(background) background.width - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 5 - minimumValue: 1 - scrollEnabled: false - } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 5 + minimumValue: 1 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 5 } } function saveValues() { speedSetting = speedSlider.value dataToSave = {"speedSetting": speedSetting} } } diff --git a/src/activities/bargame/ActivityConfig.qml b/src/activities/bargame/ActivityConfig.qml index 71f37c111..b2acadf2f 100644 --- a/src/activities/bargame/ActivityConfig.qml +++ b/src/activities/bargame/ActivityConfig.qml @@ -1,68 +1,69 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Easy"), "value": 1 }, { "text": qsTr("Medium"), "value": 2 }, { "text": qsTr("Difficult"), "value": 3 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your difficulty") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; if (newMode != dataToSave["mode"]) { dataToSave["mode"] = newMode; dataToSave = {"mode": dataToSave["mode"]}; } } } diff --git a/src/activities/bargame_2players/ActivityConfig.qml b/src/activities/bargame_2players/ActivityConfig.qml index 71f37c111..b2acadf2f 100644 --- a/src/activities/bargame_2players/ActivityConfig.qml +++ b/src/activities/bargame_2players/ActivityConfig.qml @@ -1,68 +1,69 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Easy"), "value": 1 }, { "text": qsTr("Medium"), "value": 2 }, { "text": qsTr("Difficult"), "value": 3 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your difficulty") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; if (newMode != dataToSave["mode"]) { dataToSave["mode"] = newMode; dataToSave = {"mode": dataToSave["mode"]}; } } } diff --git a/src/activities/click_on_letter/ActivityConfig.qml b/src/activities/click_on_letter/ActivityConfig.qml index 01004d1c7..db67810fd 100644 --- a/src/activities/click_on_letter/ActivityConfig.qml +++ b/src/activities/click_on_letter/ActivityConfig.qml @@ -1,92 +1,89 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } setLocale(newLocale); dataToSave = {"locale": newLocale, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/click_on_letter_up/ActivityConfig.qml b/src/activities/click_on_letter_up/ActivityConfig.qml index 01004d1c7..db67810fd 100644 --- a/src/activities/click_on_letter_up/ActivityConfig.qml +++ b/src/activities/click_on_letter_up/ActivityConfig.qml @@ -1,92 +1,89 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } setLocale(newLocale); dataToSave = {"locale": newLocale, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/clickanddraw/ActivityConfig.qml b/src/activities/clickanddraw/ActivityConfig.qml index 93aca8e5e..fb9b99a19 100644 --- a/src/activities/clickanddraw/ActivityConfig.qml +++ b/src/activities/clickanddraw/ActivityConfig.qml @@ -1,64 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Automatic"), "value": 1 }, { "text": qsTr("Manual"), "value": 2 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Go to next level") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/digital_electricity/ActivityConfig.qml b/src/activities/digital_electricity/ActivityConfig.qml index 647b5da65..0a16ad1f6 100644 --- a/src/activities/digital_electricity/ActivityConfig.qml +++ b/src/activities/digital_electricity/ActivityConfig.qml @@ -1,67 +1,67 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Deepak Kumar * * Authors: * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" import "digital_electricity.js" as Activity Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Tutorial Mode"), "value": "tutorial" }, { "text": qsTr("Free Mode"), "value": "free" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your mode") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "tutorial"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; Activity.reset() } } diff --git a/src/activities/drawletters/ActivityConfig.qml b/src/activities/drawletters/ActivityConfig.qml index 93aca8e5e..fb9b99a19 100644 --- a/src/activities/drawletters/ActivityConfig.qml +++ b/src/activities/drawletters/ActivityConfig.qml @@ -1,64 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Automatic"), "value": 1 }, { "text": qsTr("Manual"), "value": 2 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Go to next level") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/drawnumbers/ActivityConfig.qml b/src/activities/drawnumbers/ActivityConfig.qml index 93aca8e5e..fb9b99a19 100644 --- a/src/activities/drawnumbers/ActivityConfig.qml +++ b/src/activities/drawnumbers/ActivityConfig.qml @@ -1,64 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Automatic"), "value": 1 }, { "text": qsTr("Manual"), "value": 2 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Go to next level") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/enumerate/ActivityConfig.qml b/src/activities/enumerate/ActivityConfig.qml index 08d905039..bd2529e8b 100644 --- a/src/activities/enumerate/ActivityConfig.qml +++ b/src/activities/enumerate/ActivityConfig.qml @@ -1,59 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Timothée Giet * * Authors: * Timothée Giet * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Automatic"), "value": 1 }, { "text": qsTr("OK button"), "value": 2 } ] - GCComboBox { - id: modeBox - model: availableModes - background: activityConfiguration.background - label: qsTr("Validate answers") + + Column { + spacing: 10 * ApplicationInfo.ratio + width: parent.width + GCComboBox { + id: modeBox + model: availableModes + background: activityConfiguration.background + label: qsTr("Validate answers") + } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/gletters/ActivityConfig.qml b/src/activities/gletters/ActivityConfig.qml index 00d6e6b89..6c9576af5 100644 --- a/src/activities/gletters/ActivityConfig.qml +++ b/src/activities/gletters/ActivityConfig.qml @@ -1,136 +1,129 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2019 Akshay Kumar * * Authors: * Akshay Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property alias uppercaseBox: uppercaseBox property alias speedSlider: speedSlider property int speedSetting: 10 property bool uppercaseOnly: false property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") + } + GCDialogCheckBox { + id: uppercaseBox width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } - GCDialogCheckBox { - id: uppercaseBox - width: activityConfiguration.width - text: qsTr("Uppercase only mode") - checked: uppercaseOnly - } - GCText { - id: speedSliderText - text: qsTr("Speed") - fontSize: mediumSize - wrapMode: Text.WordWrap - } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 10 - minimumValue: 1 - scrollEnabled: false - } - } + text: qsTr("Uppercase only mode") + checked: uppercaseOnly + } + GCText { + id: speedSliderText + text: qsTr("Speed") + fontSize: mediumSize + wrapMode: Text.WordWrap + } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 10 + minimumValue: 1 + scrollEnabled: false } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { // Recreate the binding uppercaseBox.checked = Qt.binding(function(){return activityConfiguration.uppercaseOnly;}) speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } activityConfiguration.uppercaseOnly = (dataToSave.uppercaseMode === "true") if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } activityConfiguration.uppercaseOnly = activityConfiguration.uppercaseBox.checked speedSetting = speedSlider.value setLocale(newLocale); dataToSave = {"locale": newLocale, "uppercaseMode": "" + activityConfiguration.uppercaseOnly, "speedSetting": speedSetting, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/graph-coloring/ActivityConfig.qml b/src/activities/graph-coloring/ActivityConfig.qml index f95b8ec2b..302527084 100644 --- a/src/activities/graph-coloring/ActivityConfig.qml +++ b/src/activities/graph-coloring/ActivityConfig.qml @@ -1,65 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Colors"), "value": "color" }, { "text": qsTr("Shapes"), "value": "symbol" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your mode") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "color"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/hangman/ActivityConfig.qml b/src/activities/hangman/ActivityConfig.qml index dec7cbdfd..e8deb46f8 100644 --- a/src/activities/hangman/ActivityConfig.qml +++ b/src/activities/hangman/ActivityConfig.qml @@ -1,110 +1,107 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property string locale: "system" property string configurationLocale: "system" property alias easyModeBox: easyModeBox property bool easyMode: false width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } - GCDialogCheckBox { - id: easyModeBox - width: parent.width - text: qsTr("Display image to find as hint") - checked: activityConfiguration.easyMode - onCheckedChanged: { - activityConfiguration.easyMode = checked - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") + } + GCDialogCheckBox { + id: easyModeBox + width: parent.width + text: qsTr("Display image to find as hint") + checked: activityConfiguration.easyMode + onCheckedChanged: { + activityConfiguration.easyMode = checked } } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { // Recreate the binding easyModeBox.checked = Qt.binding(function(){return activityConfiguration.easyMode;}) var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } activityConfiguration.easyMode = (dataToSave.easyMode === "true") for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } setLocale(newLocale); activityConfiguration.easyMode = activityConfiguration.easyModeBox.checked dataToSave = {"locale": newLocale, "activityLocale": activityConfiguration.locale, "easyMode": "" + activityConfiguration.easyMode} } } diff --git a/src/activities/missing-letter/ActivityConfig.qml b/src/activities/missing-letter/ActivityConfig.qml index 48ac641c2..db67810fd 100644 --- a/src/activities/missing-letter/ActivityConfig.qml +++ b/src/activities/missing-letter/ActivityConfig.qml @@ -1,92 +1,89 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } - + if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } setLocale(newLocale); dataToSave = {"locale": newLocale, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/note_names/ActivityConfig.qml b/src/activities/note_names/ActivityConfig.qml index 80e4c4799..fd2e148ec 100644 --- a/src/activities/note_names/ActivityConfig.qml +++ b/src/activities/note_names/ActivityConfig.qml @@ -1,74 +1,67 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 5 width: if(background) background.width Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCText { - id: speedSliderText - text: qsTr("Speed") - fontSize: mediumSize - wrapMode: Text.WordWrap - } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - minimumValue: 1 - maximumValue: 5 - scrollEnabled: false - } - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCText { + id: speedSliderText + text: qsTr("Speed") + fontSize: mediumSize + wrapMode: Text.WordWrap + } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + minimumValue: 1 + maximumValue: 5 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { // Recreate the binding speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 5 } } function saveValues() { dataToSave = {"speedSetting": speedSlider.value} } } diff --git a/src/activities/number_sequence/ActivityConfig.qml b/src/activities/number_sequence/ActivityConfig.qml index 93aca8e5e..fb9b99a19 100644 --- a/src/activities/number_sequence/ActivityConfig.qml +++ b/src/activities/number_sequence/ActivityConfig.qml @@ -1,64 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Shubham Mishra * * Authors: * Shubham Mishra * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 + import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Automatic"), "value": 1 }, { "text": qsTr("Manual"), "value": 2 } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Go to next level") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = 1; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value == dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/play_piano/ActivityConfig.qml b/src/activities/play_piano/ActivityConfig.qml index f160480d4..af5b6b3f0 100644 --- a/src/activities/play_piano/ActivityConfig.qml +++ b/src/activities/play_piano/ActivityConfig.qml @@ -1,88 +1,88 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import QtQuick.Controls 1.5 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background readonly property string coloredNotes: "coloredNotes" readonly property string coloredlessNotes: "colorlessNotes" property string mode: coloredNotes width: if(background) background.width ExclusiveGroup { id: configOptions } - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCDialogCheckBox { id: coloredNotesModeBox - width: flow.width - 50 + width: parent.width - 50 text: qsTr("Display colored notes.") checked: activityConfiguration.mode === coloredNotes exclusiveGroup: configOptions onCheckedChanged: { if(coloredNotesModeBox.checked) { activityConfiguration.mode = coloredNotes } } } GCDialogCheckBox { id: colorlessNotesModeBox width: coloredNotesModeBox.width text: qsTr("Display colorless notes.") checked: activityConfiguration.mode === coloredlessNotes exclusiveGroup: configOptions onCheckedChanged: { if(colorlessNotesModeBox.checked) { activityConfiguration.mode = coloredlessNotes } } } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = coloredNotes; } activityConfiguration.mode = dataToSave["mode"]; if(activityConfiguration.mode === coloredNotes) { coloredNotesModeBox.checked = true } else { colorlessNotesModeBox.checked = true } } function saveValues() { dataToSave = {"mode": activityConfiguration.mode}; } } diff --git a/src/activities/readingh/ActivityConfig.qml b/src/activities/readingh/ActivityConfig.qml index f7153eaef..1b8d49f86 100644 --- a/src/activities/readingh/ActivityConfig.qml +++ b/src/activities/readingh/ActivityConfig.qml @@ -1,124 +1,117 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property alias speedSlider: speedSlider property int speedSetting: 10 property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } - GCText { - id: speedSliderText - text: qsTr("Speed") - fontSize: mediumSize - wrapMode: Text.WordWrap - } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 10 - minimumValue: 1 - scrollEnabled: false - } - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") + } + GCText { + id: speedSliderText + text: qsTr("Speed") + fontSize: mediumSize + wrapMode: Text.WordWrap + } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 10 + minimumValue: 1 + scrollEnabled: false } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { // Recreate the binding speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } speedSetting = speedSlider.value setLocale(newLocale); dataToSave = {"locale": newLocale, "speedSetting": speedSetting, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/readingv/ActivityConfig.qml b/src/activities/readingv/ActivityConfig.qml index f7153eaef..b7fd3330a 100644 --- a/src/activities/readingv/ActivityConfig.qml +++ b/src/activities/readingv/ActivityConfig.qml @@ -1,124 +1,117 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property alias speedSlider: speedSlider property int speedSetting: 10 property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } - GCText { - id: speedSliderText - text: qsTr("Speed") - fontSize: mediumSize - wrapMode: Text.WordWrap - } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 10 - minimumValue: 1 - scrollEnabled: false - } - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") + } + GCText { + id: speedSliderText + text: qsTr("Speed") + fontSize: mediumSize + wrapMode: Text.WordWrap + } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 10 + minimumValue: 1 + scrollEnabled: false } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { // Recreate the binding speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) - + var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } speedSetting = speedSlider.value setLocale(newLocale); dataToSave = {"locale": newLocale, "speedSetting": speedSetting, "activityLocale": activityConfiguration.locale} } } diff --git a/src/activities/reversecount/ActivityConfig.qml b/src/activities/reversecount/ActivityConfig.qml index 2ca89e179..3052614ec 100644 --- a/src/activities/reversecount/ActivityConfig.qml +++ b/src/activities/reversecount/ActivityConfig.qml @@ -1,65 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2019 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Dots"), "value": "dot" }, { "text": qsTr("Arabic numbers"), "value": "number" }, { "text": qsTr("Roman numbers"), "value": "roman" }, { "text": qsTr("Images"), "value": "image" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select Domino Representation") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "dot"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/smallnumbers/ActivityConfig.qml b/src/activities/smallnumbers/ActivityConfig.qml index 13a0cbc0e..e82143936 100644 --- a/src/activities/smallnumbers/ActivityConfig.qml +++ b/src/activities/smallnumbers/ActivityConfig.qml @@ -1,71 +1,66 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias speedSlider: speedSlider property int speedSetting: 10 width: if(background) background.width - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 10 - minimumValue: 1 - scrollEnabled: false - } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 10 + minimumValue: 1 + scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } } function saveValues() { speedSetting = speedSlider.value dataToSave = {"speedSetting": speedSetting} } } diff --git a/src/activities/smallnumbers2/ActivityConfig.qml b/src/activities/smallnumbers2/ActivityConfig.qml index 0b1a1111e..842f531e6 100644 --- a/src/activities/smallnumbers2/ActivityConfig.qml +++ b/src/activities/smallnumbers2/ActivityConfig.qml @@ -1,93 +1,90 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2019 Akshay Kumar * * Authors: * Akshay Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox property var availableModes: [ { "text": qsTr("Dots"), "value": "dot" }, { "text": qsTr("Arabic numbers"), "value": "number" }, { "text": qsTr("Roman numbers"), "value": "roman" }, { "text": qsTr("Images"), "value": "image" } ] property alias speedSlider: speedSlider property int speedSetting: 10 - height: columnContent.height width: if(background) background.width Column { - id: columnContent - spacing: 10 + spacing: 10 * ApplicationInfo.ratio width: activityConfiguration.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select Domino Representation") } GCText { id: speedSliderText text: qsTr("Speed") fontSize: mediumSize wrapMode: Text.WordWrap - height: 100 } GCSlider { id: speedSlider width: 250 * ApplicationInfo.ratio value: speedSetting maximumValue: 10 minimumValue: 1 scrollEnabled: false } } property var dataToSave function setDefaultValues() { speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "dot"; modeBox.currentIndex = 0 } if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; speedSetting = speedSlider.value dataToSave = {"mode": newMode, "speedSetting": speedSetting} } } diff --git a/src/activities/solar_system/ActivityConfig.qml b/src/activities/solar_system/ActivityConfig.qml index ecd54985a..ed68c936f 100644 --- a/src/activities/solar_system/ActivityConfig.qml +++ b/src/activities/solar_system/ActivityConfig.qml @@ -1,65 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Deepak Kumar * * Authors: * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Learning Mode"), "value": "learning" }, { "text": qsTr("Assessment Mode"), "value": "assessment" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your mode") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "learning"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/superbrain/ActivityConfig.qml b/src/activities/superbrain/ActivityConfig.qml index efeebb1a7..da122eaf0 100644 --- a/src/activities/superbrain/ActivityConfig.qml +++ b/src/activities/superbrain/ActivityConfig.qml @@ -1,65 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2020 Deepak Kumar * * Authors: * Deepak Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Colors"), "value": "color" }, { "text": qsTr("Shapes"), "value": "symbol" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your mode") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "color"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/traffic/ActivityConfig.qml b/src/activities/traffic/ActivityConfig.qml index 13fc7978a..7e23a675a 100644 --- a/src/activities/traffic/ActivityConfig.qml +++ b/src/activities/traffic/ActivityConfig.qml @@ -1,65 +1,65 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2019 Johnny Jazeix * * Authors: * Johnny Jazeix * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 +import GCompris 1.0 import "../../core" Item { id: activityConfiguration property Item background property alias modeBox: modeBox width: if(background) background.width property var availableModes: [ { "text": qsTr("Colors"), "value": "COLOR" }, { "text": qsTr("Images"), "value": "IMAGE" } ] - Flow { - id: flow - spacing: 5 + Column { + spacing: 10 * ApplicationInfo.ratio width: parent.width GCComboBox { id: modeBox model: availableModes background: activityConfiguration.background label: qsTr("Select your mode") } } property var dataToSave function setDefaultValues() { if(dataToSave["mode"] === undefined) { dataToSave["mode"] = "IMAGE"; modeBox.currentIndex = 0 } for(var i = 0 ; i < availableModes.length ; i ++) { if(availableModes[i].value === dataToSave["mode"]) { modeBox.currentIndex = i; break; } } } function saveValues() { var newMode = availableModes[modeBox.currentIndex].value; dataToSave = {"mode": newMode}; } } diff --git a/src/activities/wordsgame/ActivityConfig.qml b/src/activities/wordsgame/ActivityConfig.qml index 8a4c9994d..df289de3e 100644 --- a/src/activities/wordsgame/ActivityConfig.qml +++ b/src/activities/wordsgame/ActivityConfig.qml @@ -1,136 +1,129 @@ /* GCompris - ActivityConfig.qml * * Copyright (C) 2019 Akshay Kumar * * Authors: * Akshay Kumar * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ import QtQuick 2.6 import GCompris 1.0 import "../../core" import "qrc:/gcompris/src/core/core.js" as Core Item { id: activityConfiguration property Item background property alias localeBox: localeBox property alias uppercaseBox: uppercaseBox property bool uppercaseOnly: false property alias speedSlider: speedSlider property int speedSetting: 10 property string locale: "system" property string configurationLocale: "system" width: if(background) background.width property alias availableLangs: langs.languages LanguageList { id: langs } Column { - spacing: 10 - Flow { - spacing: 5 - width: activityConfiguration.width - GCComboBox { - id: localeBox - model: langs.languages - background: activityConfiguration.background - label: qsTr("Select your locale") - } - GCDialogCheckBox { - id: uppercaseBox - width: parent.width - text: qsTr("Uppercase only mode") - checked: activityConfiguration.uppercaseOnly - } - GCText { - id: speedSliderText - text: qsTr("Speed") - fontSize: mediumSize - wrapMode: Text.WordWrap - } - Flow { - width: activityConfiguration.width - spacing: 5 - GCSlider { - id: speedSlider - width: 250 * ApplicationInfo.ratio - value: speedSetting - maximumValue: 10 - minimumValue: 1 - scrollEnabled: false - } - } + spacing: 10 * ApplicationInfo.ratio + width: activityConfiguration.width + GCComboBox { + id: localeBox + model: langs.languages + background: activityConfiguration.background + label: qsTr("Select your locale") + } + GCDialogCheckBox { + id: uppercaseBox + width: parent.width + text: qsTr("Uppercase only mode") + checked: activityConfiguration.uppercaseOnly + } + GCText { + id: speedSliderText + text: qsTr("Speed") + fontSize: mediumSize + wrapMode: Text.WordWrap + } + GCSlider { + id: speedSlider + width: 250 * ApplicationInfo.ratio + value: speedSetting + maximumValue: 10 + minimumValue: 1 + scrollEnabled: false } } function setLocale(localeToSet) { // Store the locale as-is to be displayed in menu configurationLocale = localeToSet activityConfiguration.locale = Core.resolveLocale(localeToSet) } property var dataToSave function setDefaultValues() { // Recreate the binding uppercaseBox.checked = Qt.binding(function(){return activityConfiguration.uppercaseOnly;}) speedSlider.value = Qt.binding(function() {return activityConfiguration.speedSetting;}) var localeUtf8 = dataToSave.locale; if(localeUtf8 !== "system") { localeUtf8 += ".UTF-8"; } if(dataToSave.locale) { setLocale(localeUtf8) } else { activityConfiguration.localeBox.currentIndex = 0 setLocale(activityConfiguration.availableLangs[0].locale) } for(var i = 0 ; i < activityConfiguration.availableLangs.length ; i ++) { if(activityConfiguration.availableLangs[i].locale === localeUtf8) { activityConfiguration.localeBox.currentIndex = i; break; } } activityConfiguration.uppercaseOnly = (dataToSave.uppercaseMode === "true") if(dataToSave.speedSetting) { activityConfiguration.speedSetting = dataToSave.speedSetting } else { activityConfiguration.speedSetting = 10 } } function saveValues() { var newLocale = activityConfiguration.availableLangs[activityConfiguration.localeBox.currentIndex].locale; // Remove .UTF-8 if(newLocale.indexOf('.') != -1) { newLocale = newLocale.substring(0, newLocale.indexOf('.')) } activityConfiguration.uppercaseOnly = activityConfiguration.uppercaseBox.checked speedSetting = speedSlider.value setLocale(newLocale); dataToSave = {"locale": newLocale, "uppercaseMode": "" + activityConfiguration.uppercaseOnly, "speedSetting": speedSetting, "activityLocale": activityConfiguration.locale} } }