Changeset View
Changeset View
Standalone View
Standalone View
src/activities/clockgame/Clockgame.qml
Show All 38 Lines | 37 | pageComponent: Image { | |||
---|---|---|---|---|---|
39 | source: "qrc:/gcompris/src/activities/menu/resource/background.svg" | 39 | source: "qrc:/gcompris/src/activities/menu/resource/background.svg" | ||
40 | sourceSize.width: Math.max(parent.width, parent.height) | 40 | sourceSize.width: Math.max(parent.width, parent.height) | ||
41 | fillMode: Image.PreserveAspectCrop | 41 | fillMode: Image.PreserveAspectCrop | ||
42 | anchors.fill: parent | 42 | anchors.fill: parent | ||
43 | signal start | 43 | signal start | ||
44 | signal stop | 44 | signal stop | ||
45 | 45 | | |||
46 | Component.onCompleted: { | 46 | Component.onCompleted: { | ||
47 | dialogActivityConfig.initialize() | ||||
47 | activity.start.connect(start) | 48 | activity.start.connect(start) | ||
48 | activity.stop.connect(stop) | 49 | activity.stop.connect(stop) | ||
49 | } | 50 | } | ||
50 | 51 | | |||
51 | // Add here the QML items you need to access in javascript | 52 | // Add here the QML items you need to access in javascript | ||
52 | QtObject { | 53 | QtObject { | ||
53 | id: items | 54 | id: items | ||
54 | property alias background: background | 55 | property alias background: background | ||
▲ Show 20 Lines • Show All 403 Lines • ▼ Show 20 Line(s) | 458 | if (previousM > 45 && items.currentM < 15) | |||
458 | items.currentH = (items.currentH + 1 + 12) % 12 | 459 | items.currentH = (items.currentH + 1 + 12) % 12 | ||
459 | if (previousM < 15 && items.currentM > 45) | 460 | if (previousM < 15 && items.currentM > 45) | ||
460 | items.currentH = (items.currentH - 1 + 12) % 12 | 461 | items.currentH = (items.currentH - 1 + 12) % 12 | ||
461 | } | 462 | } | ||
462 | } | 463 | } | ||
463 | } | 464 | } | ||
464 | } | 465 | } | ||
465 | 466 | | |||
467 | DialogChooseLevel { | ||||
468 | id: dialogActivityConfig | ||||
469 | currentActivity: activity.activityInfo | ||||
470 | | ||||
471 | onSaveData: { | ||||
472 | levelFolder = dialogActivityConfig.chosenLevel | ||||
473 | currentActivity.currentLevel = dialogActivityConfig.chosenLevel | ||||
474 | ApplicationSettings.setCurrentLevel(currentActivity.name, dialogActivityConfig.chosenLevel) | ||||
475 | home() | ||||
476 | } | ||||
477 | onClose: { | ||||
478 | home() | ||||
479 | } | ||||
480 | onStartActivity: { | ||||
481 | background.start() | ||||
482 | } | ||||
483 | } | ||||
484 | | ||||
466 | DialogHelp { | 485 | DialogHelp { | ||
467 | id: dialogHelp | 486 | id: dialogHelp | ||
468 | onClose: home() | 487 | onClose: home() | ||
469 | } | 488 | } | ||
470 | 489 | | |||
471 | Bar { | 490 | Bar { | ||
472 | id: bar | 491 | id: bar | ||
473 | content: BarEnumContent { | 492 | content: BarEnumContent { | ||
474 | value: help | home | level | hint | 493 | value: help | home | level | hint | activityConfig | ||
475 | } | 494 | } | ||
476 | onHelpClicked: { | 495 | onHelpClicked: { | ||
477 | displayDialog(dialogHelp) | 496 | displayDialog(dialogHelp) | ||
478 | } | 497 | } | ||
479 | onHintClicked: { | 498 | onHintClicked: { | ||
480 | helper.visible = !helper.visible | 499 | helper.visible = !helper.visible | ||
481 | } | 500 | } | ||
501 | onActivityConfigClicked: { | ||||
502 | displayDialog(dialogActivityConfig) | ||||
503 | } | ||||
482 | onPreviousLevelClicked: Activity.previousLevel() | 504 | onPreviousLevelClicked: Activity.previousLevel() | ||
483 | onNextLevelClicked: Activity.nextLevel() | 505 | onNextLevelClicked: Activity.nextLevel() | ||
484 | onHomeClicked: activity.home() | 506 | onHomeClicked: activity.home() | ||
485 | } | 507 | } | ||
486 | 508 | | |||
487 | Bonus { | 509 | Bonus { | ||
488 | id: bonus | 510 | id: bonus | ||
489 | Component.onCompleted: win.connect(Activity.nextTry) | 511 | Component.onCompleted: win.connect(Activity.nextTry) | ||
490 | } | 512 | } | ||
491 | } | 513 | } | ||
492 | } | 514 | } |