animation: Add dedicated Spinner class

We use AnimatedIcon with the same resource all over the place, cut
down on the duplication by providing a dedicated class.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/316
This commit is contained in:
Florian Müllner
2018-11-28 16:41:09 +01:00
committed by Florian Müllner
parent ae48f8bda9
commit 22e21ad7d1
5 changed files with 15 additions and 8 deletions

View File

@ -1,6 +1,7 @@
// -*- mode: js; js-indent-level: 4; indent-tabs-mode: nil -*-
const GLib = imports.gi.GLib;
const Gio = imports.gi.Gio;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
const St = imports.gi.St;
@ -86,3 +87,13 @@ var AnimatedIcon = new Lang.Class({
this.parent(file, size, size, ANIMATED_ICON_UPDATE_TIMEOUT);
}
});
var Spinner = new Lang.Class({
Name: 'Spinner',
Extends: AnimatedIcon,
_init(size) {
let file = Gio.File.new_for_uri('resource:///org/gnome/shell/theme/process-working.svg');
this.parent(file, size);
}
});