# HG changeset patch # User sl # Date 1401727951 -7200 # Node ID 3d3f781bf5431045350c169be595a55ca3fa326a # Parent bb3f9b3c64163a220067ae95af60b47a363adf9b Switching our marquee implementation from animator to animation to avoid lags. diff -r bb3f9b3c6416 -r 3d3f781bf543 MarqueeText.qml --- a/MarqueeText.qml Mon Jun 02 17:40:32 2014 +0200 +++ b/MarqueeText.qml Mon Jun 02 18:52:31 2014 +0200 @@ -30,22 +30,25 @@ //Reset to zero and restart onStopped so that we keep looping //onStopped: {scrollingText.x=0;running=true;} - XAnimator { + NumberAnimation { target: scrollingText; + properties: "x" //from: 0; to: -scrollingText.width-separatorText.width; duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds } - XAnimator { + NumberAnimation { target: separatorText; + properties: "x" from: separatorText.x; to: separatorText.x-scrollingText.width-separatorText.width; duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds } - XAnimator { + NumberAnimation { target: followingText; + properties: "x" from: followingText.x; to: followingText.x-scrollingText.width-separatorText.width; duration: (scrollingText.width+separatorText.width)*1000/pixelsPerSeconds @@ -53,47 +56,13 @@ } - - - - + //Click to start MouseArea { id:mouseArea anchors.fill: parent onClicked: { animation.running=true; - //animator.running=true; - //otherAnimator.running=true; - //scrollingText.x=-500; - - //tempX = 0; - //timer.running = true; } } - - - /* - Timer { - id:timer - interval: 33; running: false; repeat: true - onTriggered:{ - tempX = tempX + 1 - scrollingText.x = -tempX; - - if( tempX + marqueeText.width > scrollingText.width ) { - timer.running = false - pauseTimer.running = true - } - } - } - - Timer { - id:pauseTimer - interval: 500; running: false; repeat: false - onTriggered: { - scrollingText.x = 0 - } - } - */ }