mirror of
https://github.com/slint-ui/slint.git
synced 2025-10-02 14:51:15 +00:00
Print a warning when trying to animate deprecated properties
This commit is contained in:
parent
246398fcb3
commit
c771bcff45
10 changed files with 30 additions and 18 deletions
|
@ -32,8 +32,8 @@ SuperSimple := Rectangle {
|
|||
animate * { duration: 100ms; }
|
||||
// ^error{catch-all property is only allowed within transitions}
|
||||
|
||||
animate color, foo { duration: 100ms; }
|
||||
// ^error{'foo' is not an animatable property}
|
||||
animate background, foo { duration: 100ms; }
|
||||
// ^error{'foo' is not an animatable property}
|
||||
|
||||
text := Text{ animate x { duration: 1000ms; } }
|
||||
animate text.x { duration: 100ms; }
|
||||
|
|
|
@ -12,8 +12,8 @@ X := Rectangle {
|
|||
animate x { easing: ease-in; }
|
||||
animate y { easing: foo; }
|
||||
// ^error{Unknown unqualified identifier 'foo'}
|
||||
animate color { easing: a; }
|
||||
// ^error{Cannot convert int to easing}
|
||||
animate background { easing: a; }
|
||||
// ^error{Cannot convert int to easing}
|
||||
property <int> a; animate a { easing: cubic-bezier(0.01,1.46,0.94,1.37); }
|
||||
property <int> b; animate b { easing: cubic-bezier(0.01,1.46,0.94); }
|
||||
// ^error{Not enough arguments}
|
||||
|
|
|
@ -10,7 +10,7 @@ LICENSE END */
|
|||
TestCase := Rectangle {
|
||||
property<bool> checked;
|
||||
property <int> border;
|
||||
animate color { }
|
||||
animate background { }
|
||||
states [
|
||||
checked when checked: {
|
||||
color: blue;
|
||||
|
@ -25,7 +25,7 @@ TestCase := Rectangle {
|
|||
}
|
||||
in checked: {
|
||||
// ^error{The property 'background' cannot have transition because it already has an animation}
|
||||
animate color { }
|
||||
animate background { }
|
||||
}
|
||||
]
|
||||
|
||||
|
|
|
@ -15,5 +15,9 @@ Xxx := Rectangle {
|
|||
Rectangle {
|
||||
background: root.color;
|
||||
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
||||
animate color {
|
||||
// ^warning{The property 'color' has been deprecated. Please use 'background' instead}
|
||||
duration: 250ms;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue