Changeset View
Changeset View
Standalone View
Standalone View
src/activities/share/Share.qml
Show First 20 Lines • Show All 56 Lines • ▼ Show 20 Line(s) | 45 | QtObject { | |||
---|---|---|---|---|---|
57 | property alias boyWidget: boyWidget | 57 | property alias boyWidget: boyWidget | ||
58 | property alias candyWidget: candyWidget | 58 | property alias candyWidget: candyWidget | ||
59 | property alias basketWidget: basketWidget | 59 | property alias basketWidget: basketWidget | ||
60 | property alias leftWidget: leftWidget | 60 | property alias leftWidget: leftWidget | ||
61 | property int totalBoys | 61 | property int totalBoys | ||
62 | property int totalGirls | 62 | property int totalGirls | ||
63 | property int totalCandies | 63 | property int totalCandies | ||
64 | property int totalChildren: totalBoys + totalGirls | 64 | property int totalChildren: totalBoys + totalGirls | ||
65 | property var levels: activity.datasetLoader.data.length !== 0 ? activity.datasetLoader.data : null | 65 | property var levels: activity.datasetLoader.data.length !== 0 ? activity.datasetLoader.data : null | ||
AkshayCHD: What is the purpose of this check, as in the share.js file we are not making any checks based… | |||||
nothing specific, just to make this line the same across all activities but yes, we don't need this check here. So removing it. shubhammishra: nothing specific, just to make this line the same across all activities but yes, we don't need… | |||||
66 | property int barHeightAddon: ApplicationSettings.isBarHidden ? 1 : 3 | 66 | property int barHeightAddon: ApplicationSettings.isBarHidden ? 1 : 3 | ||
67 | property int cellSize: Math.round(Math.min(background.width / 12, background.height / (11 + barHeightAddon))) | 67 | property int cellSize: Math.round(Math.min(background.width / 12, background.height / (11 + barHeightAddon))) | ||
68 | property alias repeaterDropAreas: repeaterDropAreas | 68 | property alias repeaterDropAreas: repeaterDropAreas | ||
69 | property int maxNumberOfCandiesPerWidget: 8 | 69 | property int maxNumberOfCandiesPerWidget: 8 | ||
70 | } | 70 | } | ||
71 | 71 | | |||
72 | onStart: { Activity.start(items) } | 72 | onStart: { Activity.start(items) } | ||
73 | onStop: { Activity.stop() } | 73 | onStop: { Activity.stop() } | ||
▲ Show 20 Lines • Show All 163 Lines • ▼ Show 20 Line(s) | 225 | GCText { | |||
237 | width: Math.max(Math.min(parent.width * 0.8, text.length * 8), parent.width * 0.3) | 237 | width: Math.max(Math.min(parent.width * 0.8, text.length * 8), parent.width * 0.3) | ||
238 | wrapMode: TextEdit.WordWrap | 238 | wrapMode: TextEdit.WordWrap | ||
239 | } | 239 | } | ||
240 | 240 | | |||
241 | //left widget, with girl/boy/candy/basket widgets in a grid | 241 | //left widget, with girl/boy/candy/basket widgets in a grid | ||
242 | Rectangle { | 242 | Rectangle { | ||
243 | id: leftWidget | 243 | id: leftWidget | ||
244 | width: background.vert ? | 244 | width: background.vert ? | ||
245 | items.cellSize * 2.04 : background.width | 245 | items.cellSize * 2.04 : background.width | ||
Increased left widget size, to fit double digit numbers of candy shubhammishra: Increased left widget size, to fit double digit numbers of candy | |||||
246 | height: background.vert ? | 246 | height: background.vert ? | ||
247 | background.height : items.cellSize * 2.04 | 247 | background.height : items.cellSize * 2.04 | ||
248 | color: "#5a9de0" | 248 | color: "#5a9de0" | ||
249 | border.color: "#3f81c4" | 249 | border.color: "#3f81c4" | ||
250 | border.width: 4 | 250 | border.width: 4 | ||
251 | z: 4 | 251 | z: 4 | ||
252 | 252 | | |||
253 | //grid with ok button and images of a boy, a girl, a candy, a basket and the button to display the instructions | 253 | //grid with ok button and images of a boy, a girl, a candy, a basket and the button to display the instructions | ||
Show All 23 Lines | 271 | MouseArea { | |||
277 | onClicked: background.check() | 277 | onClicked: background.check() | ||
278 | } | 278 | } | ||
279 | } | 279 | } | ||
280 | 280 | | |||
281 | ChildWidget { | 281 | ChildWidget { | ||
282 | id: girlWidget | 282 | id: girlWidget | ||
283 | name: "girl" | 283 | name: "girl" | ||
284 | total: items.totalGirls | 284 | total: items.totalGirls | ||
285 | visible: items.totalGirls !== 0 | ||||
285 | current: background.currentGirls | 286 | current: background.currentGirls | ||
286 | placedInChild: background.placedInGirls | 287 | placedInChild: background.placedInGirls | ||
287 | } | 288 | } | ||
288 | 289 | | |||
289 | ChildWidget { | 290 | ChildWidget { | ||
290 | id: boyWidget | 291 | id: boyWidget | ||
291 | name: "boy" | 292 | name: "boy" | ||
293 | visible: items.totalBoys !== 0 | ||||
292 | total: items.totalBoys | 294 | total: items.totalBoys | ||
293 | current: background.currentBoys | 295 | current: background.currentBoys | ||
294 | placedInChild: background.placedInBoys | 296 | placedInChild: background.placedInBoys | ||
295 | } | 297 | } | ||
296 | 298 | | |||
297 | BasketWidget { | 299 | BasketWidget { | ||
298 | id: basketWidget | 300 | id: basketWidget | ||
299 | } | 301 | } | ||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | 359 | onSaveData: { | |||
360 | ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) | 362 | ApplicationSettings.setCurrentLevels(currentActivity.name, dialogActivityConfig.chosenLevels) | ||
361 | } | 363 | } | ||
362 | onLoadData: { | 364 | onLoadData: { | ||
363 | if(activityData && activityData["mode"]) { | 365 | if(activityData && activityData["mode"]) { | ||
364 | background.easyMode = (activityData["mode"] === "true"); | 366 | background.easyMode = (activityData["mode"] === "true"); | ||
365 | } | 367 | } | ||
366 | } | 368 | } | ||
367 | onStartActivity: { | 369 | onStartActivity: { | ||
368 | background.stop() | 370 | Activity.reloadRandom() | ||
369 | background.start() | | |||
370 | } | 371 | } | ||
371 | 372 | | |||
372 | onClose: home() | 373 | onClose: home() | ||
373 | } | 374 | } | ||
374 | 375 | | |||
375 | //bar buttons | 376 | //bar buttons | ||
376 | DialogHelp { | 377 | DialogHelp { | ||
377 | id: dialogHelp | 378 | id: dialogHelp | ||
378 | onClose: home() | 379 | onClose: home() | ||
379 | } | 380 | } | ||
380 | 381 | | |||
381 | Bar { | 382 | Bar { | ||
382 | id: bar | 383 | id: bar | ||
383 | content: BarEnumContent { value: help | home | level | reload | activityConfig } | 384 | content: BarEnumContent { value: help | home | level | reload | activityConfig} | ||
384 | onHelpClicked: { | 385 | onHelpClicked: { | ||
385 | displayDialog(dialogHelp) | 386 | displayDialog(dialogHelp) | ||
386 | } | 387 | } | ||
387 | onPreviousLevelClicked: Activity.previousLevel() | 388 | onPreviousLevelClicked: Activity.previousLevel() | ||
388 | onNextLevelClicked: Activity.nextLevel() | 389 | onNextLevelClicked: Activity.nextLevel() | ||
389 | onHomeClicked: activity.home() | 390 | onHomeClicked: activity.home() | ||
390 | onReloadClicked: Activity.reloadRandom() | 391 | onReloadClicked: Activity.reloadRandom() | ||
391 | onActivityConfigClicked: { | 392 | onActivityConfigClicked: { | ||
Show All 27 Lines |
What is the purpose of this check, as in the share.js file we are not making any checks based on the case when the value of levels is null.