Code review comment for lp://staging/~paolorotolo/ubuntu-clock-app/fix-for-1291502

Revision history for this message
Nekhelesh Ramananthan (nik90) wrote :

Another thing I noticed is that you used a timer in the StopwatchPage.qml,

// Timer to restore original size of the test after a new lap.
    Timer {
        id: animation_timer
        interval: 100
        repeat: false
        onTriggered: {
            analogStopwatch.innerLabel.font.pixelSize = units.dp(41);
        }
    }

I am pretty sure that we don't need this timer at all. What you need to do here is use a sequential animation which first increases the text size to units.dp(41) and then decrease it back to units.dp(30). I have added a sample code below to help you.

     SequentialAnimation {
         id: fontAnimation
         UbuntuNumberAnimation { target: innerLabel; property: "font.pixelSize"; to: units.dp(41) }
         UbuntuNumberAnimation { target: innerLabel; property: "font.pixelSize"; to: units.dp(30) }
     }

And then when you press the lap button, you can start the animation by,

     fontAnimation.start()

For more information on sequential animation, please refer to http://qt-project.org/doc/qt-4.8/qml-sequentialanimation.html

review: Needs Fixing

« Back to merge proposal