mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-01 14:21:16 +00:00
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:
parent
0dff3f5f78
commit
c0fab1c3e9
5 changed files with 238 additions and 47 deletions
|
@ -1,5 +1,4 @@
|
|||
|
||||
|
||||
SuperSimple := Rectangle {
|
||||
|
||||
animate x {
|
||||
|
|
40
sixtyfps_compiler/tests/basic/states_transitions.60
Normal file
40
sixtyfps_compiler/tests/basic/states_transitions.60
Normal 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 {}
|
||||
|
||||
}
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue