Changeset View
Changeset View
Standalone View
Standalone View
src/activities/numbers-odd-even/resource/tutorial5.qml
- This file was added.
1 | /* GCompris - tutorial5.qml | ||||
---|---|---|---|---|---|
2 | * | ||||
3 | * Copyright (C) 2019 Deepak Kumar <deepakdk2431@gmail.com> | ||||
4 | * | ||||
5 | * Authors: | ||||
6 | * Deepak Kumar <deepakdk2431@gmail.com> | ||||
7 | * | ||||
8 | * This program is free software; you can redistribute it and/or modify | ||||
9 | * it under the terms of the GNU General Public License as published by | ||||
10 | * the Free Software Foundation; either version 3 of the License, or | ||||
11 | * (at your option) any later version. | ||||
12 | * | ||||
13 | * This program is distributed in the hope that it will be useful, | ||||
14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
16 | * GNU General Public License for more details. | ||||
17 | * | ||||
18 | * You should have received a copy of the GNU General Public License | ||||
19 | * along with this program; if not, see <https://www.gnu.org/licenses/>. | ||||
20 | */ | ||||
21 | | ||||
22 | import QtQuick 2.6 | ||||
23 | import GCompris 1.0 | ||||
24 | | ||||
25 | import "../../../core" | ||||
26 | | ||||
27 | Rectangle { | ||||
28 | id:rect1 | ||||
29 | anchors.fill: parent | ||||
30 | color: "#80FFFFFF" | ||||
31 | | ||||
32 | GCText { | ||||
33 | id: question | ||||
34 | anchors{ | ||||
35 | left: parent.left | ||||
36 | verticalCenter: parent.verticalCenter | ||||
37 | leftMargin: parent.height * 0.1 | ||||
38 | centerIn: parent.Center | ||||
39 | top: parent.top | ||||
40 | topMargin: parent.height * 0.05 | ||||
41 | } | ||||
42 | text: qsTr( "Choose the even number") | ||||
43 | font.pixelSize: parent.height * 0.15 | ||||
44 | color: "black" | ||||
45 | horizontalAlignment: Text.AlignLeft | ||||
46 | width: 1.8 * parent.width | ||||
47 | height: 1.8 * parent.height | ||||
48 | z: 2 | ||||
49 | } | ||||
50 | | ||||
51 | GCText { | ||||
52 | id:evenNumber | ||||
53 | anchors { | ||||
54 | left: parent.left | ||||
55 | top: parent.top | ||||
56 | topMargin: parent.width * 0.1 | ||||
57 | leftMargin: parent.width * 0.1 | ||||
58 | } | ||||
59 | text: "108" | ||||
60 | font.pixelSize: parent.height * 0.4 | ||||
61 | color: "black" | ||||
62 | horizontalAlignment: Text.AlignLeft | ||||
63 | width: 0.9 * parent.width | ||||
64 | height: 0.8 * parent.height | ||||
65 | z: 2 | ||||
66 | | ||||
67 | MouseArea { | ||||
68 | anchors.fill: parent | ||||
69 | onClicked: rightmessage.visible = true | ||||
70 | } | ||||
71 | } | ||||
72 | | ||||
73 | GCText { | ||||
74 | id: oddNumber | ||||
75 | anchors { | ||||
76 | left: parent.left | ||||
77 | top: parent.top | ||||
78 | topMargin: parent.width * 0.1 | ||||
79 | leftMargin: parent.width * 0.6 | ||||
80 | } | ||||
81 | text: "111" | ||||
82 | font.pixelSize: parent.height * 0.4 | ||||
83 | color: "black" | ||||
84 | horizontalAlignment: Text.AlignLeft | ||||
85 | width: 0.9 * parent.width | ||||
86 | height: 0.9 * parent.height | ||||
87 | z: 2 | ||||
88 | | ||||
89 | MouseArea { | ||||
90 | anchors.fill: parent | ||||
91 | onClicked: wrongmessage.visible = true | ||||
92 | } | ||||
93 | } | ||||
94 | | ||||
95 | GCText { | ||||
96 | id: rightmessage | ||||
97 | anchors{ | ||||
98 | top: parent.bottom | ||||
99 | left: parent.left | ||||
100 | leftMargin: parent.height * 0.4 | ||||
101 | } | ||||
102 | text: qsTr("Great") | ||||
103 | font.pixelSize: parent.height * 0.3 | ||||
104 | color: "black" | ||||
105 | horizontalAlignment: Text.AlignLeft | ||||
106 | width: 0.9 * parent.width | ||||
107 | height: 0.9 * parent.height | ||||
108 | visible:false | ||||
109 | z: 2 | ||||
110 | } | ||||
111 | | ||||
112 | GCText { | ||||
113 | id: wrongmessage | ||||
114 | anchors{ | ||||
115 | top: parent.bottom | ||||
116 | left: parent.left | ||||
117 | leftMargin: parent.height * 0.4 | ||||
118 | } | ||||
119 | text: qsTr("No,this is not an even number") | ||||
120 | font.pixelSize: parent.height * 0.1 | ||||
121 | color: "black" | ||||
122 | horizontalAlignment: Text.AlignLeft | ||||
123 | width: 0.6 * parent.width | ||||
124 | height: 0.6 * parent.height | ||||
125 | visible: false | ||||
126 | z: 2 | ||||
127 | } | ||||
128 | } | ||||
129 | |