From 056cfc9dc63d1090b666d9423e16e52db514d3a4 Mon Sep 17 00:00:00 2001 From: Cosimo Cecchi Date: Tue, 27 Nov 2012 12:12:44 -0500 Subject: [PATCH] wanda: fix a refactor fallout load_sliced_image() would need an additional parameter, but fold the notify::mapped callback into the load callback while we're at it. --- js/ui/wanda.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/js/ui/wanda.js b/js/ui/wanda.js index 31b940d2e..285223303 100644 --- a/js/ui/wanda.js +++ b/js/ui/wanda.js @@ -53,18 +53,19 @@ const WandaIcon = new Lang.Class({ icon_size: iconSize }); } - this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, this._imgWidth, this._imgHeight); - this._animations.connect('notify::mapped', Lang.bind(this, function() { - if (this._animations.mapped && !this._timeoutId) { - this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update)); + this._animations = St.TextureCache.get_default().load_sliced_image(this._imageFile, + this._imgWidth, this._imgHeight, Lang.bind(this, + function() { + if (this._animations.mapped && !this._timeoutId) { + this._timeoutId = GLib.timeout_add(GLib.PRIORITY_DEFAULT, FISH_SPEED, Lang.bind(this, this._update)); - this._i = 0; - this._update(); - } else if (!this._animations.mapped && this._timeoutId) { - GLib.source_remove(this._timeoutId); - this._timeoutId = 0; - } - })); + this._i = 0; + this._update(); + } else if (!this._animations.mapped && this._timeoutId) { + GLib.source_remove(this._timeoutId); + this._timeoutId = 0; + } + })); return this._animations; },