More progress in states and transition parsing

Fill the object_tree with states, and part of the transition

Also make sure to duplicate animations properly in inlining
This commit is contained in:
Olivier Goffart 2020-07-20 15:04:06 +02:00
parent 0dff3f5f78
commit c0fab1c3e9
5 changed files with 238 additions and 47 deletions

View file

@ -1,5 +1,4 @@
SuperSimple := Rectangle {
animate x {

View file

@ -0,0 +1,40 @@
TestCase := Rectangle {
property<bool> checked;
property <int32> border;
states [
checked when checked: {
color: blue; // same as root.color
text.color: red;
border: 42;
}
pressed when touch.pressed: {
color: green;
border: 88;
text.foo.bar: 0;
/// ^error{'text.foo.bar' is not a valid property}
colour: yellow;
/// ^error{'colour' is not a valid property}
fox.color: yellow;
/// ^error{'fox' is not a valid element id}
text.fox: yellow;
/// ^error{'fox' not found in 'text'}
}
]
transitions [
to pressed: {
//animate * { duration: 88ms }
animate color { duration: 88ms; }
}
out pressed: {
//animate color, foo.x { duration: 300ms; }
//pause: 20ms;
animate border { duration: 120ms; }
}
]
text := Text {}
touch := TouchArea {}
}