diff --git a/js/ui/animation.js b/js/ui/animation.js index ed4637b72..cae0b5fec 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -140,12 +140,15 @@ var Spinner = class extends AnimatedIcon { params = Params.parse(params, { animate: false, + hideOnStop: false, }); let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg'); super(file, size); this.actor.opacity = 0; this._animate = params.animate; + this._hideOnStop = params.hideOnStop; + this.actor.visible = !this._hideOnStop; } _onDestroy() { @@ -155,6 +158,7 @@ var Spinner = class extends AnimatedIcon { play() { this.actor.remove_all_transitions(); + this.actor.show(); if (this._animate) { super.play(); @@ -178,11 +182,18 @@ var Spinner = class extends AnimatedIcon { opacity: 0, duration: SPINNER_ANIMATION_TIME, mode: Clutter.AnimationMode.LINEAR, - onComplete: () => super.stop() + onComplete: () => { + super.stop(); + if (this._hideOnStop) + this.actor.hide(); + }, }); } else { this.actor.opacity = 0; super.stop(); + + if (this._hideOnStop) + this.actor.hide(); } } };