diff --git a/src/activities/mosaic/ActivityInfo.qml b/src/activities/mosaic/ActivityInfo.qml index 06994b501..acfb11554 100644 --- a/src/activities/mosaic/ActivityInfo.qml +++ b/src/activities/mosaic/ActivityInfo.qml @@ -1,39 +1,40 @@ /* GCompris - ActivityInfo.qml * * Copyright (C) 2015 Bruno Coudoin * * 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 GCompris 1.0 ActivityInfo { name: "mosaic/Mosaic.qml" difficulty: 1 icon: "mosaic/mosaic.svg" author: "Bruno Coudoin <bruno.coudoin@gcompris.net>" //: Activity title title: qsTr("Rebuild the mosaic") //: Help title description: qsTr("Put each item at the same place as in the given example.") // intro: "Put each item at the same place as in the given example." //: Help goal goal: "" //: Help prerequisite prerequisite: "" //: Help manual manual: qsTr("First select the item you want to put then click on a spot on the empty area") credit: "" section: "puzzle" createdInVersion: 0 + levels: "1,2,3,4" } diff --git a/src/activities/mosaic/Mosaic.qml b/src/activities/mosaic/Mosaic.qml index f8b881d50..2b165cf9f 100644 --- a/src/activities/mosaic/Mosaic.qml +++ b/src/activities/mosaic/Mosaic.qml @@ -1,382 +1,443 @@ /* GCompris - mosaic.qml * * Copyright (C) 2014 Bruno Coudoin * * Authors: * Clement coudoin (GTK+ version) * Bruno.coudoin (Qt Quick port) * * 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 "mosaic.js" as Activity ActivityBase { id: activity onStart: focus = true onStop: {} pageComponent: Image { id: background source: Activity.url + "background.svg" sourceSize.width: Math.max(parent.width, parent.height) fillMode: Image.PreserveAspectCrop anchors.fill: parent signal start signal stop property bool keyboardMode: false property var areaWithKeyboardFocus: selector Component.onCompleted: { + dialogActivityConfig.initialize() activity.start.connect(start) activity.stop.connect(stop) } // Add here the QML items you need to access in javascript QtObject { id: items property Item main: activity.main property GCSfx audioEffects: activity.audioEffects property alias question: question property alias answer: answer property alias selector: selector - property alias nbItems: column.nbItems property alias background: background property alias bar: bar property alias bonus: bonus property string selectedItem + property var levels: activity.datasetLoader.data + property int nbItems + property int selectorLayoutColumns + property int selectorLayoutRows + property int questionLayoutColumns + property int questionLayoutRows + property string modelDisplayLayout + property real scaleGridRatio } onStart: { Activity.start(items) } onStop: { Activity.stop() } Keys.onLeftPressed: { keyboardMode = true areaWithKeyboardFocus.moveCurrentIndexLeft() } Keys.onRightPressed: { keyboardMode = true areaWithKeyboardFocus.moveCurrentIndexRight() } Keys.onUpPressed: { keyboardMode = true areaWithKeyboardFocus.moveCurrentIndexUp() } Keys.onDownPressed: { keyboardMode = true areaWithKeyboardFocus.moveCurrentIndexDown() } Keys.onEnterPressed: { selectCell() } Keys.onSpacePressed: { selectCell() } Keys.onReturnPressed: { selectCell() } Keys.onTabPressed: { keyboardMode = true areaWithKeyboardFocus.changeAreaWithKeyboardFocus() } function selectCell() { keyboardMode = true areaWithKeyboardFocus.selectCurrentCell(areaWithKeyboardFocus.currentItem) } Column { id: column spacing: 10 x: parent.width * 0.05 - y: parent.height * 0.05 + y: column.singleColumnMode ? parent.height * 0.01 : parent.height * 0.05 width: parent.width * 0.9 property int nbItems: 24 property bool horizontal: background.width >= background.height - property int nbColumns: Activity.questionLayout[nbItems][0] - property int nbLines: Activity.questionLayout[nbItems][1] + property bool singleColumnMode: items.modelDisplayLayout === "singleColumn" + property int nbColumns: items.questionLayoutColumns + property int nbLines: items.questionLayoutRows property int itemWidth: horizontal ? Math.min(width / 2 / nbColumns - 10 - 10 / nbColumns / 2, parent.height / 2 / nbLines - 10 - 10 / nbLines / 2) : Math.min(width / nbColumns - 10 - 10 / nbColumns / 2, parent.height * 0.25 / nbLines - 10 - 10 / nbLines / 2) property int itemHeight: itemWidth - property int nbSelectorColumns: horizontal ? - Activity.selectorLayout[nbItems][0] : - Activity.selectorLayout[nbItems][0] / 2 - property int nbSelectorLines: horizontal ? - Activity.selectorLayout[nbItems][1] : - Activity.selectorLayout[nbItems][1] * 2 + property int nbSelectorColumns + property int nbSelectorLines Grid { id: row spacing: 10 - columns: column.horizontal ? 2 : 1 + columns: column.singleColumnMode ? 1 : (column.horizontal ? 2 : 1) // === The Question Area === Rectangle { + id: questionRectangle height: (column.itemHeight + 10) * column.nbLines width: column.horizontal ? column.width / 2 : column.width + 10 color: "#55333333" border.color: "black" border.width: 2 radius: 5 GridView { id: question width: (column.nbColumns * column.itemWidth) + (12.5 * (column.nbColumns - 1)) height: parent.height x: 2 * ApplicationInfo.ratio y: 2 * ApplicationInfo.ratio cellHeight: cellWidth cellWidth: width / column.nbColumns interactive: false keyNavigationWraps: true delegate: Image { + id: imageQuestionId source: Activity.url + modelData fillMode: Image.PreserveAspectFit width: question.cellWidth - 5 * ApplicationInfo.ratio height: width sourceSize.width: width sourceSize.height: height } } } // === The Answer Area === Rectangle { + id: answerRectangle height: (column.itemHeight + 10) * column.nbLines width: column.horizontal ? column.width / 2 : column.width + 10 color: "#55333333" border.color: "black" border.width: 2 radius: 5 GridView { id: answer width: (column.nbColumns * column.itemWidth) + (12.5 * (column.nbColumns - 1)) height: parent.height x: 2 * ApplicationInfo.ratio cellHeight: cellWidth cellWidth: width / column.nbColumns interactive: false keyNavigationWraps: true highlightFollowsCurrentItem: true highlight: Rectangle { color: "red" border.width: 3 border.color: "black" opacity: 0.6 visible: background.keyboardMode && (background.areaWithKeyboardFocus === answer) Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } } Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } } } // If the image was directly used as a delegate (without containing it in the item), the highlight element would have been be hard to notice as it would get completely hidden by the image due to the same sizes. delegate: Item { id: cellItem width: answer.cellWidth height: answer.cellHeight readonly property int cellIndex: index Image { id: imageAnswerId source: Activity.url + modelData fillMode: Image.PreserveAspectFit width: answer.cellWidth - 5 * ApplicationInfo.ratio height: width sourceSize.width: width sourceSize.height: height anchors.centerIn: parent MouseArea { anchors.fill: parent onClicked: answer.selectCurrentCell(cellItem) } } } - function selectCurrentCell(selectedCell) { Activity.answerSelected(selectedCell.cellIndex) } function changeAreaWithKeyboardFocus() { areaWithKeyboardFocus = selector } } } } // === The Selector === Rectangle { + id: selectorRectangle height: (column.itemWidth + 10) * column.nbSelectorLines width: column.width + 10 color: "#661111AA" border.color: "black" border.width: 2 radius: 5 GridView { id: selector width: (column.nbSelectorColumns * column.itemWidth) + (12.5 * (column.nbSelectorColumns - 1)) height: parent.height x: 2 * ApplicationInfo.ratio y: 2 * ApplicationInfo.ratio cellHeight: cellWidth cellWidth: width / column.nbSelectorColumns interactive: false keyNavigationWraps: true highlightFollowsCurrentItem: true highlight: Rectangle { color: "red" border.width: 3 border.color: "black" opacity: 0.6 visible: background.keyboardMode && (background.areaWithKeyboardFocus === selector) Behavior on x { SpringAnimation { spring: 2; damping: 0.2 } } Behavior on y { SpringAnimation { spring: 2; damping: 0.2 } } } delegate: Image { id: imageId source: Activity.url + modelData fillMode: Image.PreserveAspectFit width: selector.cellWidth - 5 * ApplicationInfo.ratio height: width sourceSize.width: width sourceSize.height: height z: iAmSelected ? 10 : 1 readonly property bool iAmSelected: items.selectedItem === modelData readonly property string imageName: modelData states: [ + State { + name: "singleColumn" + when: column.singleColumnMode + PropertyChanges { + target: column + nbSelectorColumns: items.selectorLayoutColumns + nbSelectorLines: items.selectorLayoutRows + } + PropertyChanges { + target: selectorRectangle + height: (column.itemHeight + 20) * (column.nbLines / 1.05) + width: column.horizontal ? column.width / 2 : column.width + 10 + } + }, + State { + name: "doubleColumn" + when: !column.singleColumnMode + PropertyChanges { + target: column + nbSelectorColumns: horizontal ? + items.selectorLayoutColumns : + items.selectorLayoutColumns / 2 + nbSelectorLines: horizontal ? + items.selectorLayoutRows : + items.selectorLayoutRows * 2 + } + PropertyChanges { + target: selectorRectangle + width: column.width + 10 + } + }, State { name: "notclicked" when: !imageId.iAmSelected && !mouseArea.containsMouse PropertyChanges { target: imageId scale: 0.8 } }, State { name: "clicked" when: mouseArea.pressed PropertyChanges { target: imageId scale: 0.7 } }, State { name: "hover" when: mouseArea.containsMouse PropertyChanges { target: imageId scale: 1.1 } }, State { name: "selected" when: imageId.iAmSelected PropertyChanges { target: imageId scale: 1 } } ] SequentialAnimation { id: anim running: imageId.iAmSelected loops: Animation.Infinite alwaysRunToEnd: true NumberAnimation { target: imageId property: "rotation" from: 0; to: 10 duration: 200 easing.type: Easing.OutQuad } NumberAnimation { target: imageId property: "rotation" from: 10; to: -10 duration: 400 easing.type: Easing.InOutQuad } NumberAnimation { target: imageId property: "rotation" from: -10; to: 0 duration: 200 easing.type: Easing.InQuad } } Behavior on scale { NumberAnimation { duration: 70 } } MouseArea { id: mouseArea anchors.fill: imageId hoverEnabled: true onClicked: selector.selectCurrentCell(parent) } } function selectCurrentCell(selectedCell) { items.audioEffects.play("qrc:/gcompris/src/core/resource/sounds/scroll.wav") items.selectedItem = selectedCell.imageName } function changeAreaWithKeyboardFocus() { areaWithKeyboardFocus = answer } } } } + DialogChooseLevel { + id: dialogActivityConfig + currentActivity: activity.activityInfo + + onSaveData: { + levelFolder = dialogActivityConfig.chosenLevels + currentActivity.currentLevels = dialogActivityConfig.chosenLevels + ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) + // restart activity on saving + background.start() + } + onClose: { + home() + } + onStartActivity: { + background.start() + } + } + DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar - content: BarEnumContent { value: help | home | level } + content: BarEnumContent { value: help | home | level | activityConfig} onHelpClicked: { displayDialog(dialogHelp) } + onActivityConfigClicked: { + displayDialog(dialogActivityConfig) + } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() } Bonus { id: bonus Component.onCompleted: win.connect(Activity.nextLevel) } } } diff --git a/src/activities/mosaic/mosaic.js b/src/activities/mosaic/mosaic.js index 16885ab97..5884d13ba 100644 --- a/src/activities/mosaic/mosaic.js +++ b/src/activities/mosaic/mosaic.js @@ -1,139 +1,95 @@ /* GCompris - mosaic.js * * Copyright (C) 2014 Bruno Coudoin * * Authors: * Clement coudoin (GTK+ version) * Bruno.coudoin (Qt Quick port) * * 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 . */ .pragma library .import QtQuick 2.6 as Quick .import "qrc:/gcompris/src/core/core.js" as Core -var images = [ - "aquarela_colors.svg", - "giraffe.svg", - "pencil.svg", - "mouse_on_cheese.svg", - "mushroom_house.svg", - "pencils_paper.svg", - "pencils.svg", - "white_cake.svg", - "die_1.svg", - "die_2.svg", - "die_3.svg", - "die_4.svg", - "die_5.svg", - "die_6.svg", - "die_7.svg", - "die_0.svg", - "digital_die0.svg", - "digital_die1.svg", - "digital_die2.svg", - "digital_die3.svg", - "digital_die4.svg", - "digital_die5.svg", - "digital_die6.svg", - "digital_die7.svg" - ] - var questionModel var answerModel var selectorModel var url = "qrc:/gcompris/src/activities/mosaic/resource/" -// What is the grid layout based on the number of items -var questionLayout = { - 8: [4, 2], - 16: [4, 4], - 24: [6, 4] -} - -var selectorLayout = { - 8: [8, 1], - 16: [8, 2], - 24: [12, 2] -} - var currentLevel = 0 -var numberOfLevel = 16 +var numberOfLevel var items function start(items_) { items = items_ currentLevel = 0 initLevel() + numberOfLevel = items.levels.length } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 items.background.areaWithKeyboardFocus = items.selector items.selectedItem = "" + items.nbItems = items.levels[currentLevel].nbOfCells + items.questionLayoutColumns = items.levels[currentLevel].layout[0][0] + items.questionLayoutRows = items.levels[currentLevel].layout[0][1] + items.selectorLayoutColumns = items.levels[currentLevel].layout[1][0] + items.selectorLayoutRows = items.levels[currentLevel].layout[1][1] + items.modelDisplayLayout = items.levels[currentLevel].modelDisplayLayout + items.scaleGridRatio = items.levels[currentLevel].scaleGridRatio + selectorModel = items.levels[currentLevel].images - if(currentLevel < 4) { - items.nbItems = 8 - selectorModel = images.slice(currentLevel, - currentLevel + items.nbItems); - } else if(currentLevel < 8) { - items.nbItems = 16 - selectorModel = images.slice(currentLevel - 4, - currentLevel - 4 + items.nbItems); - } else { - items.nbItems = 24 - selectorModel = images.slice(0, items.nbItems); - } items.selector.model = selectorModel - questionModel = Core.shuffle(selectorModel) items.question.model = questionModel answerModel = new Array() for(var i=0; i < questionModel.length; i++) answerModel.push("die_0.svg") items.answer.model = answerModel } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); } function answerSelected(index) { if(!items.selectedItem) return items.audioEffects.play("qrc:/gcompris/src/activities/redraw/resource/brush.wav") answerModel[index] = items.selectedItem items.answer.model = answerModel if(answerModel.toString() === questionModel.toString()) { items.bonus.good("flower") } } diff --git a/src/activities/mosaic/resource/1/Data.qml b/src/activities/mosaic/resource/1/Data.qml new file mode 100644 index 000000000..c4b9107fc --- /dev/null +++ b/src/activities/mosaic/resource/1/Data.qml @@ -0,0 +1,97 @@ + /* GCompris - Data.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 GCompris 1.0 + +Data { + objective: qsTr("Up to 6 items are placed on single line.") + difficulty: 2 + + property var images: [ + "aquarela_colors.svg", + "giraffe.svg", + "pencil.svg", + "mouse_on_cheese.svg", + "mushroom_house.svg", + "pencils_paper.svg", + "pencils.svg", + "white_cake.svg", + "die_1.svg", + "die_2.svg", + "die_3.svg", + "die_4.svg", + "die_5.svg", + "die_6.svg", + "die_7.svg", + "die_0.svg", + "digital_die0.svg", + "digital_die1.svg", + "digital_die2.svg", + "digital_die3.svg", + "digital_die4.svg", + "digital_die5.svg", + "digital_die6.svg", + "digital_die7.svg" + ] + + data: [ + { + "nbOfCells": 3, + "layout": [ + [3,1], + [3,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(0,3) + }, + { + "nbOfCells": 4, + "layout": [ + [4,1], + [4,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(1,5) + }, + { + "nbOfCells": 5, + "layout": [ + [5,1], + [5,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(2,7) + }, + { + "nbOfCells": 6, + "layout": [ + [6,1], + [6,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(3,9) + + } + ] +} diff --git a/src/activities/mosaic/resource/2/Data.qml b/src/activities/mosaic/resource/2/Data.qml new file mode 100644 index 000000000..5e8509eca --- /dev/null +++ b/src/activities/mosaic/resource/2/Data.qml @@ -0,0 +1,106 @@ +/* GCompris - Data.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 GCompris 1.0 + +Data { + objective: qsTr("Up to 8 items are placed on single line.") + difficulty: 2 + + property var images: [ + "aquarela_colors.svg", + "giraffe.svg", + "pencil.svg", + "mouse_on_cheese.svg", + "mushroom_house.svg", + "pencils_paper.svg", + "pencils.svg", + "white_cake.svg", + "die_1.svg", + "die_2.svg", + "die_3.svg", + "die_4.svg", + "die_5.svg", + "die_6.svg", + "die_7.svg", + "die_0.svg", + "digital_die0.svg", + "digital_die1.svg", + "digital_die2.svg", + "digital_die3.svg", + "digital_die4.svg", + "digital_die5.svg", + "digital_die6.svg", + "digital_die7.svg" + ] + + data: [ + { + "nbOfCells": 3, + "layout": [ + [3,1], + [3,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(0,3) + }, + { + "nbOfCells": 4, + "layout": [ + [4,1], + [4,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(1,5) + }, + { + "nbOfCells": 5, + "layout": [ + [5,1], + [5,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(2,7) + }, + { + "nbOfCells": 6, + "layout": [ + [6,1], + [6,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(3,9) + }, + { + "nbOfCells": 8, + "layout": [ + [8,1], + [8,1] + ], + "modelDisplayLayout": "singleColumn", + "scaleGridRatio": 1, + "images": images.slice(5,13) + } + ] +} diff --git a/src/activities/mosaic/resource/3/Data.qml b/src/activities/mosaic/resource/3/Data.qml new file mode 100644 index 000000000..a75e1af82 --- /dev/null +++ b/src/activities/mosaic/resource/3/Data.qml @@ -0,0 +1,136 @@ +/* GCompris - Data.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 GCompris 1.0 + +Data { + objective: qsTr("Up to 16 items are placed on multiple lines.") + difficulty: 3 + + property var images: [ + "aquarela_colors.svg", + "giraffe.svg", + "pencil.svg", + "mouse_on_cheese.svg", + "mushroom_house.svg", + "pencils_paper.svg", + "pencils.svg", + "white_cake.svg", + "die_1.svg", + "die_2.svg", + "die_3.svg", + "die_4.svg", + "die_5.svg", + "die_6.svg", + "die_7.svg", + "die_0.svg", + "digital_die0.svg", + "digital_die1.svg", + "digital_die2.svg", + "digital_die3.svg", + "digital_die4.svg", + "digital_die5.svg", + "digital_die6.svg", + "digital_die7.svg" + ] + + data: [ + { + "nbOfCells": 8, + "layout": [ + [4,2], + [8,1] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(0,8) + }, + { + "nbOfCells": 8, + "layout": [ + [4,2], + [8,1] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(1,9) + }, + { + "nbOfCells": 8, + "layout": [ + [4,2], + [8,1] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(2,10) + }, + { + "nbOfCells": 8, + "layout": [ + [4,2], + [8,1] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(3,11) + }, + { + "nbOfCells": 16, + "layout": [ + [4,4], + [8,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(4,20) + }, + { + "nbOfCells": 16, + "layout": [ + [4,4], + [8,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(5,21) + }, + { + "nbOfCells": 16, + "layout": [ + [4,4], + [8,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(6,22) + }, + { + "nbOfCells": 16, + "layout": [ + [4,4], + [8,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.7, + "images": images.slice(2,18) + } + ] +} diff --git a/src/activities/mosaic/resource/4/Data.qml b/src/activities/mosaic/resource/4/Data.qml new file mode 100644 index 000000000..d876922d6 --- /dev/null +++ b/src/activities/mosaic/resource/4/Data.qml @@ -0,0 +1,136 @@ +/* GCompris - Data.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 GCompris 1.0 + +Data { + objective: qsTr("Up to 24 items are placed on multiple lines.") + difficulty: 4 + + property var images: [ + "aquarela_colors.svg", + "giraffe.svg", + "pencil.svg", + "mouse_on_cheese.svg", + "mushroom_house.svg", + "pencils_paper.svg", + "pencils.svg", + "white_cake.svg", + "die_1.svg", + "die_2.svg", + "die_3.svg", + "die_4.svg", + "die_5.svg", + "die_6.svg", + "die_7.svg", + "die_0.svg", + "digital_die0.svg", + "digital_die1.svg", + "digital_die2.svg", + "digital_die3.svg", + "digital_die4.svg", + "digital_die5.svg", + "digital_die6.svg", + "digital_die7.svg" + ] + + data: [ + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + }, + { + "nbOfCells": 24, + "layout": [ + [6,4], + [12,2] + ], + "modelDisplayLayout": "doubleColumn", + "scaleGridRatio": 1.9, + "images": images.slice(0,24) + } + ] +}