js: Use implicit animations for animatable properties
We now have everything in place to replace Tweener for all animatable properties with implicit animations, which has the following benefits: - they run entirely in C, while Tweener requires context switches to JS each frame - they are more reliable, as Tweener only detects when an animation is overwritten with another Tween, while Clutter considers any property change https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/22
This commit is contained in:
@@ -7,7 +7,6 @@ const Signals = imports.signals;
|
||||
const GrabHelper = imports.ui.grabHelper;
|
||||
const Lightbox = imports.ui.lightbox;
|
||||
const Main = imports.ui.main;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
const { loadInterfaceXML } = imports.misc.fileUtils;
|
||||
|
||||
@@ -298,14 +297,12 @@ var SelectArea = class {
|
||||
|
||||
_onButtonRelease() {
|
||||
this._result = this._getGeometry();
|
||||
Tweener.addTween(this._group,
|
||||
{ opacity: 0,
|
||||
time: 0.2,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this._grabHelper.ungrab();
|
||||
}
|
||||
});
|
||||
this._group.ease({
|
||||
opacity: 0,
|
||||
duration: 200,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => this._grabHelper.ungrab()
|
||||
});
|
||||
return Clutter.EVENT_PROPAGATE;
|
||||
}
|
||||
|
||||
@@ -382,15 +379,15 @@ var Flashspot = class extends Lightbox.Lightbox {
|
||||
fire(doneCallback) {
|
||||
this.actor.show();
|
||||
this.actor.opacity = 255;
|
||||
Tweener.addTween(this.actor,
|
||||
{ opacity: 0,
|
||||
time: FLASHSPOT_ANIMATION_OUT_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
if (doneCallback)
|
||||
doneCallback();
|
||||
this.destroy();
|
||||
}
|
||||
});
|
||||
this.actor.ease({
|
||||
opacity: 0,
|
||||
duration: FLASHSPOT_ANIMATION_OUT_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||
onComplete: () => {
|
||||
if (doneCallback)
|
||||
doneCallback();
|
||||
this.destroy();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user