diff --git a/src/activities/oware/ActivityInfo.qml b/src/activities/oware/ActivityInfo.qml index bacc0ad26..253da4eaa 100644 --- a/src/activities/oware/ActivityInfo.qml +++ b/src/activities/oware/ActivityInfo.qml @@ -1,35 +1,35 @@ /* GCompris - ActivityInfo.qml * - * Copyright (C) 2016 Divyam Madaan + * Copyright (C) 2017 Divyam Madaan * * 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: "oware/Oware.qml" difficulty: 1 icon: "oware/oware.svg" author: "Divyam Madaan <divyam3897@gmail.com>" demo: true title: "Oware activity" - description: "" + description: qsTr("Play the Oware strategy game against your friend") //intro: "put here in comment the text for the intro voice" - goal: "" + goal: qsTr("The object of the game is to capture more seeds than one's opponent. Since the game has only 48 seeds, capturing 25 is sufficient to accomplish this. Since there are an even number of seeds, it is possible for the game to end in a draw, where each player has captured 24. The game is over when one player has captured 25 or more seeds, or both players have taken 24 seeds each (draw). If both players agree that the game has been reduced to an endless cycle, each player captures the seeds on their side of the board.") prerequisite: "" - manual: "" + manual: qsTr("At the beginning of the game four seeds are placed in each house. Players take turns by moving the seeds. In each turn, a player chooses one of the six houses under his or her control. The player removes all seeds from this house, and distributes them, dropping one in each house counter-clockwise from the original house, in a process called sowing. Seeds are not distributed into the end scoring houses, nor into the house drawn from. That is, the starting house is left empty; if it contained 12 seeds, it is skipped, and the twelfth seed is placed in the next house. After a turn, if the last seed was placed into an opponent's house and brought its total to two or three, all the seeds in that house are captured and placed in the player's scoring house (or set aside if the board has no scoring houses). If the previous-to-last seed also brought the total seeds in an opponent's house to two or three, these are captured as well, and so on. However, if a move would capture all an opponent's seeds, the capture is forfeited, and the seeds are instead left on the board, since this would prevent the opponent from continuing the game. The proscription against capturing all an opponent's seeds is related to a more general idea, that one ought to make a move that allows the opponent to continue playing. If an opponent's houses are all empty, the current player must make a move that gives the opponent seeds. If no such move is possible, the current player captures all seeds in his/her own territory, ending the game. (Source Wikipedia <http://en.wikipedia.org/wiki/Oware>)") credit: "" section: "strategy" createdInVersion: 8000 } diff --git a/src/activities/oware/Oware.qml b/src/activities/oware/Oware.qml index 556a60751..90d86a035 100644 --- a/src/activities/oware/Oware.qml +++ b/src/activities/oware/Oware.qml @@ -1,272 +1,406 @@ /* GCompris - Oware.qml * * Copyright (C) 2017 Divyam Madaan * * Authors: - * (GTK+ version) + * Frederic Mazzarol (GTK+ version) * Divyam Madaan (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 "oware.js" as Activity import "." ActivityBase { id: activity onStart: focus = true onStop: {} pageComponent: Image { id: background anchors.fill: parent source: "qrc:/gcompris/src/activities/guesscount/resource/backgroundW01.svg" signal start signal stop Component.onCompleted: { 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 alias background: background property alias bar: bar property alias bonus: bonus - property alias message: message - property alias hintDialog: hintDialog property alias repeater: repeater - property bool playerOne: true + property bool playerOneTurn: true + property bool isTutorial: true + property alias tutorialTxt: tutorialTxt.text + property alias tutNum: tutorialTxt.tutNum property var playerOneScore: 0 property var playerOneSeeds: 0 property var playerTwoScore: 0 property var playerTwoSeeds: 0 } onStart: { Activity.start(items) } onStop: { Activity.stop() } Image { id: board - source: Activity.url + "/awele_board.png" + source: Activity.url + "/owareBoard.png" anchors.centerIn: parent width: parent.width * 0.7 height: width * 0.4 - } - - IntroMessage { - id: message - anchors { - top: parent.top - topMargin: 10 - right: parent.right - rightMargin: 5 - left: parent.left - leftMargin: 5 - } - z: 100 - intro: [ - qsTr("An oware board has two rows of 6 houses. Each player controls six houses. The game begins with 4 seeds in each house."), - qsTr("Players take turns moving the seeds. On a turn, a player chooses one of the six houses under their control. The player removes all seeds from that house, and distributes them, dropping one in each house clockwise or counter clockwise from this house, in a process called sowing.") , - qsTr("When the dropped seeds make the number of seeds two or three in opponent's houses then they are captured. The players can capture seeds only from opponent's holes and never from their own holes.The player who captures the maximum seeds wins the game.") - ] + visible: !items.isTutorial } Grid { id:boardGrid columns: 6 rows: 2 anchors.horizontalCenter: board.horizontalCenter anchors.top: board.top + visible: !items.isTutorial Repeater { id:repeater model: 12 Rectangle { color: "transparent" height: board.height/2 width: board.width * (1/6.25) property var circleRadius: width property var value: 4 GCText { text: value color: "white" anchors.top: parent.top anchors.horizontalCenter: parent.horizontalCenter } + Repeater { model: value Image { - source: Activity.url + "graine2.png" + id: grain + source: Activity.url + "grain2.png" height: circleRadius * 0.2 width: circleRadius * 0.2 x: circleRadius/2 + Activity.getX(circleRadius/6,index,value) y: circleRadius/2 + Activity.getY(circleRadius/5,index,value) + + //To move the seeds from one hole to other on button click. Not working :( + states: State { + name: "move" + when: buttonClick.containsPress + PropertyChanges { + target: grain + scale: 1.1 + } + } } } } } } ListView { id: rowButton width: boardGrid.width height: boardGrid.height * 0.25 orientation: ListView.Horizontal model: 6 anchors.horizontalCenter: board.horizontalCenter anchors.top: board.bottom interactive: false + visible: !items.isTutorial delegate: Item { height: parent.height width: boardGrid.width/6 Image { id: valueImage - source: Activity.url + "bouton" + (index + 1) + ".png" + source: Activity.url + "button" + (index + 1) + ".png" anchors.fill: parent MouseArea { + id: buttonClick anchors.fill:parent hoverEnabled: true onClicked: { - Activity.sowSeeds(index); - items.playerOne = (items.playerOne == true) ? false : true +// Activity.sowSeeds(index); + items.playerOneTurn = (!items.playerOneTurn == true) ? false : true } onPressed: { - valueImage.source = Activity.url + "bouton" + (index + 1) + "_clic.png"; + valueImage.source = Activity.url + "button" + (index + 1) + "Click.png"; } onReleased: { - valueImage.source = Activity.url + "bouton" + (index + 1) + ".png"; + valueImage.source = Activity.url + "button" + (index + 1) + ".png"; } onEntered: { - valueImage.source = Activity.url + "bouton" + (index + 1) + "_notify.png"; + valueImage.source = Activity.url + "button" + (index + 1) + "Notify.png"; } onExited: { - valueImage.source = Activity.url + "bouton" + (index + 1) + ".png"; + valueImage.source = Activity.url + "button" + (index + 1) + ".png"; } - } + } } } } ScoreItem { id: playerOneLevelScore player: 1 height: Math.min(background.height/7, Math.min(background.width/7, bar.height * 1.05)) - width: height*11/8 + width: height * 11/8 + visible: !items.isTutorial anchors { top: background.top topMargin: 5 left: background.left leftMargin: 5 } playerImageSource: Activity.url + "stone_1.svg" backgroundImageSource: Activity.url + "score_1.svg" } ScoreItem { id: playerTwoLevelScore player: 2 height: Math.min(background.height/7, Math.min(background.width/7, bar.height * 1.05)) width: height*11/8 + visible: !items.isTutorial anchors { top: background.top topMargin: 5 right: background.right rightMargin: 5 } playerImageSource: Activity.url + "stone_2.svg" backgroundImageSource: Activity.url + "score_2.svg" } Image { id: playerOneScoreBox height: board.height * 0.4 width: height source:Activity.url+"/score.png" anchors.verticalCenter: parent.verticalCenter anchors.right: board.left + visible: !items.isTutorial GCText { id: playerOneScoreText color: "white" - property var textSource:Activity.playerTwoPoints anchors.centerIn: parent fontSize: smallSize text: items.playerOneScore horizontalAlignment: Text.AlignHCenter wrapMode: TextEdit.WordWrap } } Image { id: playerTwoScore height: board.height * 0.4 width: height source:Activity.url+"/score.png" anchors.verticalCenter: parent.verticalCenter anchors.left: board.right + visible: !items.isTutorial GCText { id: playerTwoScoreText color: "white" - property var textSource:Activity.playerTwoPoints anchors.centerIn: parent fontSize: smallSize text: items.playerTwoScore horizontalAlignment: Text.AlignHCenter wrapMode: TextEdit.WordWrap } } - DialogBackground { - id: hintDialog - visible: false - title: qsTr("Rules") - textBody: qsTr("An oware board has two rows of 6 houses. Each player controls six houses. The game begins with 4 seeds in each house. Players take turns moving the seeds. On a turn, a player chooses one of the six houses under their control. The player removes all seeds from that house, and distributes them, dropping one in each house clockwise or counter clockwise from this house, in a process called sowing. When the dropped seeds make the number of seeds two or three in opponent's houses then they are captured. The players can capture seeds only from opponent's holes and never from their own holes.The player who captures the maximum seeds wins the game.") - onClose: home() + Image { + id: previousTutorial + source: "qrc:/gcompris/src/core/resource/bar_previous.svg" + sourceSize.height: skipTutorial.height * 1.1 + visible: items.isTutorial && tutorialTxt.tutNum != 1 + anchors { + top: parent.top + topMargin: 5 + right: skipTutorialContainer.left + rightMargin: 5 + } + + MouseArea { + id: previousArea + width: parent.width + height: parent.height + onClicked: {Activity.tutorialPrevious()} + } + } + + Image { + id: nextTutorial + source: "qrc:/gcompris/src/core/resource/bar_next.svg" + sourceSize.height: skipTutorial.height * 1.1 + visible: items.isTutorial && tutorialTxt.tutNum != 3 + anchors { + top: parent.top + topMargin: 5 + left: skipTutorialContainer.right + leftMargin: 5 + } + + MouseArea { + id: nextArea + width: parent.width + height: parent.height + onClicked: {Activity.tutorialNext()} + } + } + + GCText { + id: skipTutorial + anchors { + horizontalCenter: parent.horizontalCenter + top: parent.top + topMargin: 5 + } + fontSizeMode: Text.Fit + minimumPixelSize: 10 + color: "white" + style: Text.Outline + styleColor: "black" + horizontalAlignment: Text.AlignHCenter + width: Math.min(implicitWidth, 0.8 * parent.width ) + height: implicitHeight + visible: items.isTutorial + text: qsTr("Skip tutorial") + z: 2 + } + + Rectangle { + id: skipTutorialContainer + anchors.top: skipTutorial.top + anchors.horizontalCenter: skipTutorial.horizontalCenter + width: skipTutorial.width + 10 + height: skipTutorial.height + 2 + opacity: 0.8 + radius: 10 + border.width: 2 + border.color: "black" + visible: items.isTutorial + gradient: Gradient { + GradientStop { position: 0.0; color: "#000" } + GradientStop { position: 0.9; color: "#666" } + GradientStop { position: 1.0; color: "#AAA" } + } + MouseArea { + id: skipArea + hoverEnabled: true + width: parent.width + height: parent.height + onEntered: {skipTutorialContainer.border.color = "#62db53"} + onExited: {skipTutorialContainer.border.color = "black"} + onClicked: {Activity.tutorialSkip()} + } + } + + GCText { + id: tutorialTxt + anchors { + horizontalCenter: parent.horizontalCenter + top: skipTutorial.bottom + topMargin: skipTutorial.height * 0.5 + } + fontSizeMode: Text.Fit + minimumPixelSize: 10 + color: "black" + horizontalAlignment: Text.AlignHLeft + width: Math.min(implicitWidth, 0.8 * parent.width ) + height: Math.min(implicitHeight, 0.25 * parent.height ) + wrapMode: TextEdit.WordWrap + visible: items.isTutorial + z: 2 + property int tutNum: 1 + } + + Rectangle { + id: tutorialTxtContainer + anchors.top: tutorialTxt.top + anchors.horizontalCenter: tutorialTxt.horizontalCenter + width: tutorialTxt.width + 20 + height: tutorialTxt.height + 2 + opacity: 0.8 + radius: 10 + border.width: 6 + color: "white" + border.color: "#87A6DD" + visible: items.isTutorial + /* + gradient: Gradient { + GradientStop { position: 0.0; color: "#000" } + GradientStop { position: 0.9; color: "#666" } + GradientStop { position: 1.0; color: "#AAA" } + }*/ + } + + Image { + id: tutorialImage + source: "qrc:/gcompris/src/activities/oware/resource/" + "tutorial" + tutorialTxt.tutNum + ".png" + property int heightNeed: background.height - tutorialTxtContainer.height - bar.height - + 2 * skipTutorialContainer.height + width: (sourceSize.width/sourceSize.height) > (0.9 * background.width / heightNeed) ? + 0.9 * background.width : (sourceSize.width * heightNeed) / sourceSize.height + fillMode: Image.PreserveAspectFit + visible: items.isTutorial + anchors { + top: tutorialTxt.bottom + topMargin: 10 + horizontalCenter: parent.horizontalCenter + } } + // Tutorial section ends DialogHelp { id: dialogHelp onClose: home() } Bar { id: bar - content: BarEnumContent { value: help | home | level | hint} + content: BarEnumContent { value: help | home | level } onHelpClicked: { displayDialog(dialogHelp) } onPreviousLevelClicked: Activity.previousLevel() onNextLevelClicked: Activity.nextLevel() onHomeClicked: activity.home() - onHintClicked: displayDialog(hintDialog) } Bonus { id: bonus - Component.onCompleted: win.connect(Activity.nextLevel) } } } diff --git a/src/activities/oware/oware.js b/src/activities/oware/oware.js index 5532e9efc..44c2860a9 100644 --- a/src/activities/oware/oware.js +++ b/src/activities/oware/oware.js @@ -1,83 +1,115 @@ /* GCompris - oware.js * - * Copyright (C) 2016 YOUR NAME + * Copyright (C) 2017 Divyam Madaan * * Authors: - * (GTK+ version) - * "YOUR NAME" (Qt Quick port) + * Frederic Mazzarol (GTK+ version) + * Divyam Madaan (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 var currentLevel = 0 var numberOfLevel = 4 var items var url = "qrc:/gcompris/src/activities/oware/resource/" function start(items_) { items = items_ currentLevel = 0 initLevel() + tutorial() } function stop() { } function initLevel() { items.bar.level = currentLevel + 1 } function nextLevel() { if(numberOfLevel <= ++currentLevel ) { currentLevel = 0 } initLevel(); } function previousLevel() { if(--currentLevel < 0) { currentLevel = numberOfLevel - 1 } initLevel(); } function getX(radius,index,value){ var step=(2 * Math.PI) * index/value; return radius * Math.cos(step); } function getY(radius,index,value){ var step = (2 * Math.PI) * index/value; return radius * Math.sin(step); } +function tutorial() { + items.isTutorial = true + setTutorial(1) +} + +function setTutorial(tutNum) { + + if(tutNum == 1) { + items.tutorialTxt = qsTr("At the beginning of the game four seeds are placed in each house. Players take turns by moving the seeds") + } + else if(tutNum == 2) { + items.tutorialTxt = qsTr("In each turn, a player chooses one of the six houses under his or her control. The player removes all seeds from this house, and distributes them, dropping one in each house counter-clockwise from the original house, in a process called sowing.") + } + else if(tutNum == 3) { + items.tutorialTxt = qsTr("After a turn, if the last seed was placed into an opponent's house and brought its total to two or three, all the seeds in that house are captured and placed in the player's scoring house (or set aside if the board has no scoring houses). If the previous-to-last seed also brought the total seeds in an opponent's house to two or three, these are captured as well, and so on.") + } +} + +function tutorialSkip() { + items.isTutorial = false + initLevel() +} + +function tutorialNext() { + setTutorial(++items.tutNum) +} + +function tutorialPrevious() { + setTutorial(--items.tutNum) +} + function sowSeeds(index) { var nbSeeds = items.repeater.itemAt(index).value if(nbSeeds == 0) return; - items.repeater.itemAt(index).value = 0; var last,j,seeds; seeds = nbSeeds print(index) - for (j = 1, last = (index + 1) % 12 ; j <= nbSeeds; j++) { + items.repeater.itemAt(index).value = 0; + /* + for (j = 1, last = (index + 1) % 12; j <= nbSeeds; j++) { items.repeater.itemAt(last).value += 1 last = (last + 1) % 12 seeds -= 1 if(seeds == 0 && items.repeater.itemAt(last).value != 0) { seeds = items.repeater.itemAt(last).value sowSeeds(last) - } - } + }*/ } diff --git a/src/activities/oware/oware.svg b/src/activities/oware/oware.svg index cba275faa..654520892 100644 --- a/src/activities/oware/oware.svg +++ b/src/activities/oware/oware.svg @@ -1,83 +1,199 @@ - + sodipodi:docbase="/home/mat/Travaux/Inkscape/Gcompris/boardicons" + sodipodi:docname="awele.svg"> + id="defs2887" /> + width="100px" + inkscape:window-width="1064" + inkscape:window-height="816" + inkscape:window-x="34" + inkscape:window-y="20" /> + id="metadata2890"> image/svg+xml - - - + style="fill:black;fill-opacity:0.1935484;fill-rule:evenodd;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" + d="M 20.718081,30.104395 L 13.843081,30.948145 C 13.41504,31.590206 7.8648693,34.592065 7.4368313,35.448145 C 7.0087903,36.304226 5.3118323,41.448143 5.3118313,41.448145 L 6.3743313,48.916895 L 9.561831,53.010645 L 14.061831,54.073145 C 14.061831,54.073145 15.547029,54.274202 17.374331,54.479395 L 12.468081,55.073145 C 12.04004,55.715206 6.4586243,58.717063 6.0305813,59.573145 C 5.6025413,60.429226 3.9055793,65.573141 3.9055813,65.573145 L 4.9680813,73.073145 L 8.1868313,77.135645 L 12.686831,78.198145 C 12.686831,78.198145 20.173482,79.255915 23.811831,79.041895 C 27.450175,78.827875 31.718934,79.907435 35.999331,79.479395 C 40.279741,79.051355 47.996461,79.068415 49.280581,78.854395 C 50.564701,78.640375 56.351531,78.635645 59.561831,78.635645 C 62.772141,78.635645 70.238851,79.479395 72.593081,79.479395 C 74.947301,79.479395 86.532441,78.626185 88.030581,78.198145 C 91.204131,76.356555 91.655811,75.601425 94.874331,73.698145 C 95.730411,73.056085 96.999321,66.013519 96.999331,64.729395 C 96.999331,63.445273 93.999331,56.791896 93.999331,56.791895 L 86.530581,55.073145 C 85.162081,54.994426 83.400001,54.950039 81.593081,54.885645 C 85.121101,54.611431 88.622681,54.296832 89.405581,54.073145 C 92.579121,52.231562 93.030811,51.476425 96.249331,49.573145 C 97.105421,48.931084 98.405578,41.857263 98.405578,40.573145 C 98.405578,39.289023 95.405581,32.666893 95.405581,32.666895 L 87.905581,30.948145 C 83.375351,30.687556 74.849261,30.548967 72.936831,30.323145 C 72.936831,30.323145 63.950181,30.938687 60.311831,30.510645 C 56.673491,30.082605 48.093081,30.323146 48.093081,30.323145 L 34.186831,30.510645 L 20.718081,30.104395 z M 57.343081,54.510645 C 58.610521,54.504423 59.949711,54.510644 60.936831,54.510645 C 62.004731,54.510645 63.580761,54.602959 65.249331,54.729395 C 62.897081,54.800195 60.432861,54.846577 58.905581,54.666895 C 58.450791,54.61339 57.925371,54.545758 57.343081,54.510645 z " + id="path2888" /> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/activities/oware/oware.svg b/src/activities/oware/oware_backup.svg similarity index 100% copy from src/activities/oware/oware.svg copy to src/activities/oware/oware_backup.svg diff --git a/src/activities/oware/resource/awele-board2.png b/src/activities/oware/resource/awele-board2.png deleted file mode 100644 index 24dd705ab..000000000 Binary files a/src/activities/oware/resource/awele-board2.png and /dev/null differ diff --git a/src/activities/oware/resource/bouton1.png b/src/activities/oware/resource/button1.png similarity index 100% rename from src/activities/oware/resource/bouton1.png rename to src/activities/oware/resource/button1.png diff --git a/src/activities/oware/resource/bouton1_clic.png b/src/activities/oware/resource/button1Click.png similarity index 100% rename from src/activities/oware/resource/bouton1_clic.png rename to src/activities/oware/resource/button1Click.png diff --git a/src/activities/oware/resource/bouton1_notify.png b/src/activities/oware/resource/button1Notify.png similarity index 100% rename from src/activities/oware/resource/bouton1_notify.png rename to src/activities/oware/resource/button1Notify.png diff --git a/src/activities/oware/resource/bouton2.png b/src/activities/oware/resource/button2.png similarity index 100% rename from src/activities/oware/resource/bouton2.png rename to src/activities/oware/resource/button2.png diff --git a/src/activities/oware/resource/bouton2_clic.png b/src/activities/oware/resource/button2Click.png similarity index 100% rename from src/activities/oware/resource/bouton2_clic.png rename to src/activities/oware/resource/button2Click.png diff --git a/src/activities/oware/resource/bouton2_notify.png b/src/activities/oware/resource/button2Notify.png similarity index 100% rename from src/activities/oware/resource/bouton2_notify.png rename to src/activities/oware/resource/button2Notify.png diff --git a/src/activities/oware/resource/bouton3.png b/src/activities/oware/resource/button3.png similarity index 100% rename from src/activities/oware/resource/bouton3.png rename to src/activities/oware/resource/button3.png diff --git a/src/activities/oware/resource/bouton3_clic.png b/src/activities/oware/resource/button3Click.png similarity index 100% rename from src/activities/oware/resource/bouton3_clic.png rename to src/activities/oware/resource/button3Click.png diff --git a/src/activities/oware/resource/bouton3_notify.png b/src/activities/oware/resource/button3Notify.png similarity index 100% rename from src/activities/oware/resource/bouton3_notify.png rename to src/activities/oware/resource/button3Notify.png diff --git a/src/activities/oware/resource/bouton4.png b/src/activities/oware/resource/button4.png similarity index 100% rename from src/activities/oware/resource/bouton4.png rename to src/activities/oware/resource/button4.png diff --git a/src/activities/oware/resource/bouton4_clic.png b/src/activities/oware/resource/button4Click.png similarity index 100% rename from src/activities/oware/resource/bouton4_clic.png rename to src/activities/oware/resource/button4Click.png diff --git a/src/activities/oware/resource/bouton4_notify.png b/src/activities/oware/resource/button4Notify.png similarity index 100% rename from src/activities/oware/resource/bouton4_notify.png rename to src/activities/oware/resource/button4Notify.png diff --git a/src/activities/oware/resource/bouton5.png b/src/activities/oware/resource/button5.png similarity index 100% rename from src/activities/oware/resource/bouton5.png rename to src/activities/oware/resource/button5.png diff --git a/src/activities/oware/resource/bouton5_clic.png b/src/activities/oware/resource/button5Click.png similarity index 100% rename from src/activities/oware/resource/bouton5_clic.png rename to src/activities/oware/resource/button5Click.png diff --git a/src/activities/oware/resource/bouton5_notify.png b/src/activities/oware/resource/button5Notify.png similarity index 100% rename from src/activities/oware/resource/bouton5_notify.png rename to src/activities/oware/resource/button5Notify.png diff --git a/src/activities/oware/resource/bouton6.png b/src/activities/oware/resource/button6.png similarity index 100% rename from src/activities/oware/resource/bouton6.png rename to src/activities/oware/resource/button6.png diff --git a/src/activities/oware/resource/bouton6_clic.png b/src/activities/oware/resource/button6Click.png similarity index 100% rename from src/activities/oware/resource/bouton6_clic.png rename to src/activities/oware/resource/button6Click.png diff --git a/src/activities/oware/resource/bouton6_notify.png b/src/activities/oware/resource/button6Notify.png similarity index 100% rename from src/activities/oware/resource/bouton6_notify.png rename to src/activities/oware/resource/button6Notify.png diff --git a/src/activities/oware/resource/graine1.png b/src/activities/oware/resource/grain1.png similarity index 100% rename from src/activities/oware/resource/graine1.png rename to src/activities/oware/resource/grain1.png diff --git a/src/activities/oware/resource/graine2.png b/src/activities/oware/resource/grain2.png similarity index 100% rename from src/activities/oware/resource/graine2.png rename to src/activities/oware/resource/grain2.png diff --git a/src/activities/oware/resource/graine3.png b/src/activities/oware/resource/grain3.png similarity index 100% rename from src/activities/oware/resource/graine3.png rename to src/activities/oware/resource/grain3.png diff --git a/src/activities/oware/resource/graine4.png b/src/activities/oware/resource/grain4.png similarity index 100% rename from src/activities/oware/resource/graine4.png rename to src/activities/oware/resource/grain4.png diff --git a/src/activities/oware/resource/awele_board.png b/src/activities/oware/resource/owareBoard.png similarity index 100% rename from src/activities/oware/resource/awele_board.png rename to src/activities/oware/resource/owareBoard.png diff --git a/src/activities/oware/resource/tutorial1.png b/src/activities/oware/resource/tutorial1.png new file mode 100644 index 000000000..2bd2dbdcb Binary files /dev/null and b/src/activities/oware/resource/tutorial1.png differ diff --git a/src/activities/oware/resource/tutorial2.png b/src/activities/oware/resource/tutorial2.png new file mode 100644 index 000000000..839a2b0a7 Binary files /dev/null and b/src/activities/oware/resource/tutorial2.png differ diff --git a/src/core/DialogBackground.qml b/src/core/DialogBackground.qml index 8800b4dad..be0661375 100644 --- a/src/core/DialogBackground.qml +++ b/src/core/DialogBackground.qml @@ -1,131 +1,130 @@ /* GCompris - dialogBackground.qml * * Copyright (C) 2014 Bruno Coudoin * * Authors: * 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 QtQuick 2.6 import QtQuick.Controls 1.5 import GCompris 1.0 /** * Base QML component for all full screen dialog screens. * @ingroup components * * Defines the general screen layout used by the following full screen * dialog elements: * * DialogAbout, DialogHelp. * * For a general purpose dialog cf. GCDialog. * * @inherit QtQuick.Rectangle */ Rectangle { id: dialogBackground color: "#696da3" border.color: "black" border.width: 1 z: 1000 property bool isDialog: true property string title property alias titleIcon: titleIcon.source - property alias textBody: textContent.text property string content signal close signal start signal pause signal play signal stop Row { spacing: 2 Item { width: 10; height: 1 } Column { spacing: 10 anchors.top: parent.top Item { width: 1; height: 10 } Rectangle { color: "#e6e6e6" radius: 6.0 width: dialogBackground.width - 30 height: title.height * 1.2 border.color: "black" border.width: 2 Image { id: titleIcon anchors { left: parent.left top: parent.top margins: 4 * ApplicationInfo.ratio } } GCText { id: title text: dialogBackground.title width: dialogBackground.width - 30 horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter color: "black" fontSize: 20 font.weight: Font.DemiBold wrapMode: Text.WordWrap } } Rectangle { color: "#e6e6e6" radius: 6.0 width: dialogBackground.width - 30 height: dialogBackground.height - 100 border.color: "black" border.width: 2 anchors.margins: 100 Flickable { id: flick anchors.margins: 8 anchors.fill: parent contentWidth: textContent.contentWidth contentHeight: textContent.contentHeight flickableDirection: Flickable.VerticalFlick clip: true GCText { id: textContent text: style + "" + content + "" width: flick.width height: flick.height fontSize: regularSize wrapMode: TextEdit.Wrap textFormat: TextEdit.RichText property string style: "" } } } Item { width: 1; height: 10 } } } // The cancel button GCButtonCancel { onClose: parent.close() } }