~sil/dropping-letters/add-vcs

« back to all changes in this revision

Viewing changes to dropping-letters.qml

  • Committer: Tarmac
  • Author(s): Victor Thompson
  • Date: 2014-09-14 00:08:31 UTC
  • mfrom: (62.1.2 pause-button)
  • Revision ID: tarmac-20140914000831-mrkn19fe2uakudsx
* Add a pause/resume button
* Remove unused icons. Fixes: https://bugs.launchpad.net/bugs/1369133.

Approved by Alan Pope  ʕ•͡ᴥ•ʔ, Ubuntu Phone Apps Jenkins Bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
        main.score = 0;
28
28
        droptimer.start();
29
29
        toolbar.opened = false;
 
30
        game.paused = false;
30
31
    }
31
32
 
32
33
    Page {
35
36
            id: toolbar
36
37
            ToolbarButton {
37
38
                text: i18n.tr("Sound")
38
 
                iconSource: (volume.audible ? "audio-volume-high-symbolic.svg" : "audio-volume-muted-symbolic.svg")
 
39
                iconName: volume.audible ? "speaker" : "speaker-mute"
39
40
                visible: volume.supportsMedia
40
41
                onTriggered: {
41
42
                    volume.audible = !volume.audible;
44
45
            ToolbarButton {
45
46
                objectName: "new_game"
46
47
                text: i18n.tr("New game")
47
 
                iconSource: ("new.png")
 
48
                iconName: "add"
48
49
                onTriggered: {
49
50
                    resetGame();
50
51
                }
51
52
            }
 
53
            ToolbarButton {
 
54
                objectName: "pause_game"
 
55
                text: game.paused ? i18n.tr("Resume") : i18n.tr("Pause")
 
56
                iconName: game.paused ? "media-playback-start": "media-playback-pause"
 
57
                enabled: flipable.flipped
 
58
                onTriggered: {
 
59
                    if (game.paused) {
 
60
                        droptimer.start();
 
61
                    } else {
 
62
                        droptimer.stop();
 
63
                    }
 
64
 
 
65
                    game.paused = !game.paused;
 
66
                }
 
67
            }
52
68
        }
53
69
 
54
70
        Item {
546
562
                    id: game
547
563
                    objectName: "gametile"
548
564
                    property int squaresize: Math.min((flipable.width) / 7, (flipable.height - (flipable.minChromeHeight * 2)) / 10)
 
565
                    property bool paused: false;
549
566
                    anchors.top: topbar.bottom
550
567
                    anchors.bottom: bottombar.top
551
568
                    anchors.left: main.left