Changeset View
Changeset View
Standalone View
Standalone View
src/activities/memory/MemoryCommon.qml
Context not available. | |||||
45 | fillMode: Image.PreserveAspectCrop | 45 | fillMode: Image.PreserveAspectCrop | ||
---|---|---|---|---|---|
46 | focus: true | 46 | focus: true | ||
47 | 47 | | |||
48 | property bool isVertical: background.width < background.height // To check vertical mode | ||||
49 | | ||||
48 | signal start | 50 | signal start | ||
49 | signal stop | 51 | signal stop | ||
50 | 52 | | |||
Context not available. | |||||
144 | right: parent.right | 146 | right: parent.right | ||
145 | rightMargin: 2 * ApplicationInfo.ratio | 147 | rightMargin: 2 * ApplicationInfo.ratio | ||
146 | } | 148 | } | ||
149 | visible: !background.isVertical | ||||
147 | width: height * 0.83 | 150 | width: height * 0.83 | ||
148 | height: bar.height * 1.2 | 151 | height: bar.height * 1.2 | ||
149 | 152 | | |||
Context not available. | |||||
160 | } | 163 | } | ||
161 | } | 164 | } | ||
162 | 165 | | |||
166 | Rectangle { | ||||
167 | id: verticalPlayer | ||||
jjazeix: qsTr() needed to translate string.
You can also use arg to have a better localisation. | |||||
jjazeix: you don't display anything on horizontal mode? | |||||
on Horizontal mode i display either "You" or "Score" and the score depending on whether it is 2 player or not. harrymecwan: on Horizontal mode i display either "You" or "Score" and the score depending on whether it is 2… | |||||
168 | visible: background.isVertical | ||||
169 | anchors { | ||||
170 | bottom: bar.bottom | ||||
171 | right: parent.right | ||||
172 | bottomMargin: 45 * ApplicationInfo.ratio | ||||
173 | } | ||||
174 | color: "#00a0e2" | ||||
175 | | ||||
176 | border { | ||||
177 | color: "white" | ||||
178 | width: 2 * ApplicationInfo.ratio | ||||
179 | } | ||||
180 | | ||||
181 | radius: 2 * ApplicationInfo.ratio | ||||
182 | width: height * (background.isVertical ? 1.5 : 2.5) | ||||
183 | height: bar.height / 2 | ||||
184 | | ||||
185 | GCText { | ||||
186 | id: verticalPlayerScore | ||||
187 | anchors.centerIn: parent | ||||
188 | color: "black" | ||||
189 | font.bold: true | ||||
190 | fontSize: mediumSize | ||||
if the text is longer (because in another language, it has more characters), is the text contained in the rectangle or does it override? jjazeix: if the text is longer (because in another language, it has more characters), is the text… | |||||
harrymecwan: it does not. i'll fix that. :) | |||||
191 | style: Text.Outline | ||||
192 | styleColor: "white" | ||||
193 | text: items.playerScore | ||||
194 | } | ||||
195 | } | ||||
196 | | ||||
163 | Image { | 197 | Image { | ||
164 | id: tux | 198 | id: tux | ||
165 | visible: activity.withTux | 199 | visible: activity.withTux && !background.isVertical | ||
166 | source: 'qrc:/gcompris/src/activities/memory/resource/tux-teacher.svg' | 200 | source: 'qrc:/gcompris/src/activities/memory/resource/tux-teacher.svg' | ||
167 | anchors { | 201 | anchors { | ||
168 | bottom: bar.bottom | 202 | bottom: bar.bottom | ||
Context not available. | |||||
185 | } | 219 | } | ||
186 | } | 220 | } | ||
187 | 221 | | |||
222 | Rectangle { | ||||
223 | id: verticalTux | ||||
224 | visible: activity.withTux && background.isVertical | ||||
225 | anchors { | ||||
226 | bottom: bar.bottom | ||||
227 | right: parent.right | ||||
228 | bottomMargin: 2 * ApplicationInfo.ratio | ||||
229 | } | ||||
230 | color: "#e2a000" | ||||
231 | | ||||
232 | border { | ||||
233 | color: "white" | ||||
234 | width: 2 * ApplicationInfo.ratio | ||||
235 | } | ||||
236 | | ||||
237 | radius: 2 * ApplicationInfo.ratio | ||||
238 | width: height * (background.isVertical ? 1.5 : 2.5) | ||||
239 | height: bar.height / 2 | ||||
240 | | ||||
241 | GCText { | ||||
242 | id: verticalTuxScore | ||||
243 | anchors.centerIn: parent | ||||
244 | color: "black" | ||||
245 | font.bold: true | ||||
246 | fontSize: mediumSize | ||||
247 | style: Text.Outline | ||||
248 | styleColor: "white" | ||||
249 | text: items.tuxScore | ||||
250 | } | ||||
251 | } | ||||
252 | | ||||
188 | Bonus { | 253 | Bonus { | ||
189 | id: bonus | 254 | id: bonus | ||
190 | interval: 2000 | 255 | interval: 2000 | ||
Context not available. |
qsTr() needed to translate string.
You can also use arg to have a better localisation.