slint/sixtyfps_compiler/tests/basic/animate.60
Simon Hausmann ab697ab71d Parse animation declarations into the object tree
So

    animate x { ... }

is basically a short-hand for

    PropertyAnimation {
        ...
    }

    <magically associated that animation with x whenever x is changed>

We could also support a shared animation syntax in the future:

    blah := PropertyAnimation { ... }

    animate x with blah;
    animate y with blah;

This patch also adds a primitive PropertyAnimation struct, which will be
used by the generated code to collect the values specified in the .60
markup.
2020-06-24 17:43:48 +02:00

23 lines
343 B
Text

SuperSimple := Rectangle {
animate x {
duration: 1000;
}
animate x {
// ^error{Duplicated animation}
duration: 1000;
}
animate y {
nonexistent: 42;
// ^error{Unknown property nonexistent}
}
animate text {
// ^error{'text' is not an animatable property}
}
}