From c9cd4fbcd03bf0e59f335839bd936e288eb26dca Mon Sep 17 00:00:00 2001 From: Daniel van Vugt Date: Mon, 10 Feb 2025 16:04:18 +0800 Subject: [PATCH] animation: Add (integer) geometry scaling support to Spinner Until now it only supported (float) fractional scaling. Since the SpinnerContent requires a Clutter size in logical pixels, we need to specify that at map time when the scaling factor is known. Closes: https://gitlab.gnome.org/GNOME/gnome-shell/-/issues/8126 Part-of: --- js/ui/animation.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/js/ui/animation.js b/js/ui/animation.js index cf5336e48..ba6ebb484 100644 --- a/js/ui/animation.js +++ b/js/ui/animation.js @@ -15,16 +15,22 @@ class Spinner extends St.Widget { hideOnStop: false, }); super({ - width: size, - height: size, opacity: 0, }); + this._size = size; this._animate = params.animate; this._hideOnStop = params.hideOnStop; this.visible = !this._hideOnStop; } + vfunc_map() { + const {scaleFactor} = St.ThemeContext.get_for_stage(global.stage); + const logicalSize = this._size * scaleFactor; + this.set_size(logicalSize, logicalSize); + super.vfunc_map(); + } + play() { this.remove_all_transitions(); this.set_content(new St.SpinnerContent());