cleanup: Stop using Tweener

gnome-shell added convenience API for Clutter animations and replaced
Tweener everywhere; follow suite and do the same.

https://gitlab.gnome.org/GNOME/gnome-shell-extensions/merge_requests/87
This commit is contained in:
Florian Müllner
2019-08-07 23:50:30 +02:00
parent af6f5fea54
commit 80de26dc16
2 changed files with 9 additions and 10 deletions
@@ -25,7 +25,7 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
const Tweener = imports.ui.tweener;
const MESSAGE_FADE_TIME = 2;
const MESSAGE_FADE_TIME = 2000;
let text;
@@ -40,7 +40,7 @@ function flashMessage(message) {
Main.uiGroup.add_actor(text);
}
Tweener.removeTweens(text);
text.remove_all_transitions();
text.text = message;
text.opacity = 255;
@@ -50,11 +50,11 @@ function flashMessage(message) {
monitor.x + Math.floor(monitor.width / 2 - text.width / 2),
monitor.y + Math.floor(monitor.height / 2 - text.height / 2));
Tweener.addTween(text, {
text.ease({
opacity: 0,
time: MESSAGE_FADE_TIME,
transition: 'easeOutQuad',
onComplete: hideMessage
duration: MESSAGE_FADE_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete: hideMessage,
});
}
+3 -4
View File
@@ -6,7 +6,6 @@ const ExtensionUtils = imports.misc.extensionUtils;
const Main = imports.ui.main;
const Overview = imports.ui.overview;
const PopupMenu = imports.ui.popupMenu;
const Tweener = imports.ui.tweener;
const Me = ExtensionUtils.getCurrentExtension();
const { WindowPicker, WindowPickerToggle } = Me.imports.windowPicker;
@@ -843,10 +842,10 @@ const WindowList = GObject.registerClass({
_updateWindowListVisibility() {
let visible = !Main.windowPicker.visible;
Tweener.addTween(this._windowList, {
this._windowList.ease({
opacity: visible ? 255 : 0,
transition: 'ease-out-quad',
time: Overview.ANIMATION_TIME / 1000
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
duration: Overview.ANIMATION_TIME,
});
this._windowList.reactive = visible;