Code review comment for lp:~osomon/unity-2d/dnd-reorder-apps

Revision history for this message
Ugo Riboni (uriboni) wrote :

201 +
202 + /* Delay the animation on y to when the item has been initially positioned. */
203 + Timer {
204 + id: canAnimateY
205 + triggeredOnStart: true
206 + onTriggered: {
207 + stop()
208 + looseItem.animateY = true
209 + }
210 + }
211 + Component.onCompleted: canAnimateY.start()

First off, this seems like a rather contrived way to fire the timer immediately and only once. Wouldn't have been simpler to just make interval: 0 and not set triggeredOnStart and stop() inside the trigger function ?

Second, do I understand it correctly that what you basically need is to activate the animation on the next iteration of the event loop after Component.onCompleted, and that you need to do this since during Component.onCompleted the Y of the component is still not positioned ?

review: Needs Information

« Back to merge proposal