[gnome-shell/gnome-3-34] animation: Turn Spinner animate parameter into Params option
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gnome-3-34] animation: Turn Spinner animate parameter into Params option
- Date: Tue, 19 Nov 2019 21:48:07 +0000 (UTC)
commit 96ac00b53cdca3db2aa0f881b71c41b4a1e1c015
Author: Joonas Henriksson <joonas henriksson gmail com>
Date: Mon Nov 18 22:18:29 2019 +0200
animation: Turn Spinner animate parameter into Params option
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/834
js/ui/animation.js | 13 +++++++++++--
js/ui/components/keyring.js | 4 +++-
js/ui/components/polkitAgent.js | 4 +++-
js/ui/panel.js | 4 +++-
js/ui/shellMountOperation.js | 4 +++-
5 files changed, 23 insertions(+), 6 deletions(-)
---
diff --git a/js/ui/animation.js b/js/ui/animation.js
index 18c837e822..ed4637b720 100644
--- a/js/ui/animation.js
+++ b/js/ui/animation.js
@@ -3,6 +3,8 @@
const { Clutter, GLib, Gio, St } = imports.gi;
+const Params = imports.misc.params;
+
var ANIMATED_ICON_UPDATE_TIMEOUT = 16;
var SPINNER_ANIMATION_TIME = 300;
var SPINNER_ANIMATION_DELAY = 1000;
@@ -131,12 +133,19 @@ var AnimatedIcon = class extends Animation {
};
var Spinner = class extends AnimatedIcon {
- constructor(size, animate = false) {
+ constructor(size, params) {
+ // Compatibility with older callers
+ if (params === true || params === false)
+ params = { animate: params };
+
+ params = Params.parse(params, {
+ animate: 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 = animate;
+ this._animate = params.animate;
}
_onDestroy() {
diff --git a/js/ui/components/keyring.js b/js/ui/components/keyring.js
index 66948b65d9..24bcc6c3dd 100644
--- a/js/ui/components/keyring.js
+++ b/js/ui/components/keyring.js
@@ -74,7 +74,9 @@ class KeyringDialog extends ModalDialog.ModalDialog {
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
this._passwordEntry.clutter_text.connect('activate', this._onPasswordActivate.bind(this));
- this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+ this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+ animate: true,
+ });
if (rtl) {
layout.attach(this._workSpinner.actor, 0, row, 1, 1);
diff --git a/js/ui/components/polkitAgent.js b/js/ui/components/polkitAgent.js
index 1c1b8e610e..991927c8ae 100644
--- a/js/ui/components/polkitAgent.js
+++ b/js/ui/components/polkitAgent.js
@@ -105,7 +105,9 @@ var AuthenticationDialog = GObject.registerClass({
this._passwordBox.add(this._passwordEntry,
{ expand: true });
- this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+ this._workspinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+ animate: true,
+ });
this._passwordBox.add(this._workSpinner.actor);
this.setInitialKeyFocus(this._passwordEntry);
diff --git a/js/ui/panel.js b/js/ui/panel.js
index 49c0038fac..2b2d66bf9a 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -234,7 +234,9 @@ var AppMenuButton = GObject.registerClass({
this._overviewHidingId = Main.overview.connect('hiding', this._sync.bind(this));
this._overviewShowingId = Main.overview.connect('showing', this._sync.bind(this));
- this._spinner = new Animation.Spinner(PANEL_ICON_SIZE, true);
+ this._spinner = new Animation.Spinner(PANEL_ICON_SIZE, {
+ animate: true,
+ });
this._container.add_actor(this._spinner.actor);
let menu = new AppMenu(this);
diff --git a/js/ui/shellMountOperation.js b/js/ui/shellMountOperation.js
index ff5cb23667..5c08c36713 100644
--- a/js/ui/shellMountOperation.js
+++ b/js/ui/shellMountOperation.js
@@ -359,7 +359,9 @@ var ShellMountPasswordDialog = GObject.registerClass({
this._passwordEntry.clutter_text.set_password_char('\u25cf'); // ● U+25CF BLACK CIRCLE
ShellEntry.addContextMenu(this._passwordEntry, { isPassword: true });
this.setInitialKeyFocus(this._passwordEntry);
- this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, true);
+ this._workSpinner = new Animation.Spinner(WORK_SPINNER_ICON_SIZE, {
+ animate: true,
+ });
this._passwordEntry.secondary_icon = this._workSpinner.actor;
if (rtl) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]