[gnome-shell] iconGrid: Only add one onComplete callback for the animations
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] iconGrid: Only add one onComplete callback for the animations
- Date: Fri, 16 Aug 2019 15:04:17 +0000 (UTC)
commit 6f4c5022ebf9a29584c4347bce9f5c9602b77a34
Author: Jonas Dreßler <verdre v0yd nl>
Date: Fri Aug 9 00:18:38 2019 +0200
iconGrid: Only add one onComplete callback for the animations
We only need a callback on the last animated actor, so no need to
register the callback for all actors.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/678
js/ui/iconGrid.js | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/js/ui/iconGrid.js b/js/ui/iconGrid.js
index 1fbf416c5f..e0a1e8bd8a 100644
--- a/js/ui/iconGrid.js
+++ b/js/ui/iconGrid.js
@@ -545,12 +545,12 @@ var IconGrid = GObject.registerClass({
scale_y: 1,
duration: ANIMATION_TIME_IN,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
- delay,
- onComplete: () => {
- if (isLastItem)
- this._animationDone();
- }
+ delay
};
+
+ if (isLastItem)
+ movementParams.onComplete = this._animationDone.bind(this);
+
fadeParams = {
opacity: 255,
duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
@@ -571,13 +571,12 @@ var IconGrid = GObject.registerClass({
scale_y: scaleY,
duration: ANIMATION_TIME_OUT,
mode: Clutter.AnimationMode.EASE_IN_OUT_QUAD,
- delay,
- onComplete: () => {
- if (isLastItem) {
- this._animationDone();
- }
- }
+ delay
};
+
+ if (isLastItem)
+ movementParams.onComplete = this._animationDone.bind(this);
+
fadeParams = {
opacity: 0,
duration: ANIMATION_FADE_IN_TIME_FOR_ITEM,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]