environment: Add convenience method for adjustment transitions

By now, Tweener is used exclusively to animate changes to the
StAdjustment:value property. But not for long, as now that we
implement the same transition API as Clutter.Actor, we can
re-use the existing convenience method for property transitions
for adjustment changes as well.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/669
This commit is contained in:
Florian Müllner 2019-07-25 16:21:46 +02:00
parent 72defaa97e
commit 8ac2086ed1

View File

@ -220,6 +220,11 @@ function init() {
Clutter.Actor.prototype.ease_property = function(propName, target, params) { Clutter.Actor.prototype.ease_property = function(propName, target, params) {
_easeActorProperty(this, propName, target, params); _easeActorProperty(this, propName, target, params);
}; };
St.Adjustment.prototype.ease = function(target, params) {
// we're not an actor of course, but we implement the same
// transition API as Clutter.Actor, so this works anyway
_easeActorProperty(this, 'value', target, params);
};
Clutter.Actor.prototype.toString = function() { Clutter.Actor.prototype.toString = function() {
return St.describe_actor(this); return St.describe_actor(this);