Print a warning when trying to animate deprecated properties

This commit is contained in:
Simon Hausmann 2021-02-02 22:50:52 +01:00
parent 246398fcb3
commit c771bcff45
10 changed files with 30 additions and 18 deletions

View file

@ -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; }

View file

@ -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}

View file

@ -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 { }
}
]

View file

@ -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;
}
}
}