MarqueeText.qml
changeset 33 cf5eba52cb1d
parent 32 1c2a7f563019
child 34 f2c87f0cfabe
     1.1 --- a/MarqueeText.qml	Wed Jun 04 08:12:37 2014 +0200
     1.2 +++ b/MarqueeText.qml	Wed Jun 04 18:30:37 2014 +0200
     1.3 @@ -35,10 +35,11 @@
     1.4          //Reset to zero and restart onStopped so that we keep looping
     1.5          //onStopped: {scrollingText.x=0;running=true;}
     1.6  
     1.7 -        property int lengthInPixels:scrollingText.width-separatorText.width-scrollingText.x;
     1.8 +        property int lengthInPixels:(scrollingText.width+separatorText.width)-scrollingText.x;
     1.9          property int durationInMs:(animation.lengthInPixels)*1000/pixelsPerSeconds;
    1.10  
    1.11          NumberAnimation {
    1.12 +            id: animationScrollingTest
    1.13              target: scrollingText;
    1.14              properties: "x"
    1.15              from: scrollingText.x;
    1.16 @@ -68,22 +69,23 @@
    1.17      MouseArea {
    1.18          id:mouseArea
    1.19          anchors.fill: parent
    1.20 -        onClicked: {animation.running=!animation.running;
    1.21 -            /*
    1.22 +        onClicked: {
    1.23 +            //animation.running=!animation.running;
    1.24 +
    1.25              if (!animation.running) {
    1.26                  animation.start();
    1.27                  return;
    1.28              }
    1.29              if (animation.paused)
    1.30              {
    1.31 -                console.log("resume")
    1.32 -                animation.resume;
    1.33 +                //console.log("resume")
    1.34 +                animation.resume();
    1.35              }
    1.36              else
    1.37              {
    1.38 -                console.log("pause")
    1.39 -                animation.pause;
    1.40 -            }*/
    1.41 +                //console.log("pause")
    1.42 +                animation.pause();
    1.43 +            }
    1.44          }
    1.45      }
    1.46  }