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:
@ -13,7 +13,6 @@ const Overview = imports.ui.overview;
|
||||
const PopupMenu = imports.ui.popupMenu;
|
||||
const PanelMenu = imports.ui.panelMenu;
|
||||
const Main = imports.ui.main;
|
||||
const Tweener = imports.ui.tweener;
|
||||
|
||||
var PANEL_ICON_SIZE = 16;
|
||||
var APP_MENU_ICON_MARGIN = 0;
|
||||
@ -262,11 +261,12 @@ var AppMenuButton = GObject.registerClass({
|
||||
this._visible = true;
|
||||
this.reactive = true;
|
||||
this.show();
|
||||
Tweener.removeTweens(this);
|
||||
Tweener.addTween(this,
|
||||
{ opacity: 255,
|
||||
time: Overview.ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad' });
|
||||
this.remove_all_transitions();
|
||||
this.ease({
|
||||
opacity: 255,
|
||||
duration: Overview.ANIMATION_TIME,
|
||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD
|
||||
});
|
||||
}
|
||||
|
||||
fadeOut() {
|
||||
@ -275,14 +275,13 @@ var AppMenuButton = GObject.registerClass({
|
||||
|
||||
this._visible = false;
|
||||
this.reactive = false;
|
||||
Tweener.removeTweens(this);
|
||||
Tweener.addTween(this,
|
||||
{ opacity: 0,
|
||||
time: Overview.ANIMATION_TIME / 1000,
|
||||
transition: 'easeOutQuad',
|
||||
onComplete: () => {
|
||||
this.hide();
|
||||
} });
|
||||
this.remove_all_transitions();
|
||||
this.ease({
|
||||
opacity: 0,
|
||||
mode: Clutter.Animation.EASE_OUT_QUAD,
|
||||
duration: Overview.ANIMATION_TIME,
|
||||
onComplete: () => this.hide()
|
||||
});
|
||||
}
|
||||
|
||||
_syncIcon() {
|
||||
|
Reference in New Issue
Block a user