[gnome-shell] panel: Use dedicated Spinner class
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] panel: Use dedicated Spinner class
- Date: Mon, 22 Jul 2019 16:25:11 +0000 (UTC)
commit 2743f18af465d9a47cf4c71ba572687709d0a1a7
Author: Florian Müllner <fmuellner gnome org>
Date: Mon Jul 22 16:46:40 2019 +0200
panel: Use dedicated Spinner class
The startup/busy indication in the app menu was left out of commit
22e21ad7d1 because it doesn't use a hard-coded image, but as the
image in the CSS is actually the same used by the spinner class,
drop the "custom" styling and use the regular spinner.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/636
data/theme/gnome-shell-sass/_common.scss | 1 -
js/ui/panel.js | 42 +++-----------------------------
2 files changed, 3 insertions(+), 40 deletions(-)
---
diff --git a/data/theme/gnome-shell-sass/_common.scss b/data/theme/gnome-shell-sass/_common.scss
index ea912ff3c..4e6469188 100644
--- a/data/theme/gnome-shell-sass/_common.scss
+++ b/data/theme/gnome-shell-sass/_common.scss
@@ -1171,7 +1171,6 @@ StScrollBar {
// a little unstructured mess:
#appMenu {
- spinner-image: url("resource:///org/gnome/shell/theme/process-working.svg");
spacing: 4px;
.label-shadow { color: transparent; }
diff --git a/js/ui/panel.js b/js/ui/panel.js
index e36bf4c35..6eb54f3e7 100644
--- a/js/ui/panel.js
+++ b/js/ui/panel.js
@@ -203,7 +203,6 @@ var AppMenuButton = GObject.registerClass({
this._busyNotifyId = 0;
let bin = new St.Bin({ name: 'appMenu' });
- bin.connect('style-changed', this._onStyleChanged.bind(this));
this.add_actor(bin);
this.bind_property("reactive", this, "can-focus", 0);
@@ -238,9 +237,8 @@ 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._stop = true;
-
- this._spinner = null;
+ this._spinner = new Animation.Spinner(PANEL_ICON_SIZE, true);
+ this._container.add_actor(this._spinner.actor);
let menu = new AppMenu(this);
this.setMenu(menu);
@@ -288,17 +286,6 @@ var AppMenuButton = GObject.registerClass({
} });
}
- _onStyleChanged(actor) {
- let node = actor.get_theme_node();
- let [success, icon] = node.lookup_url('spinner-image', false);
- if (!success || (this._spinnerIcon && this._spinnerIcon.equal(icon)))
- return;
- this._spinnerIcon = icon;
- this._spinner = new Animation.AnimatedIcon(this._spinnerIcon, PANEL_ICON_SIZE);
- this._container.add_actor(this._spinner.actor);
- this._spinner.actor.hide();
- }
-
_syncIcon() {
if (!this._targetApp)
return;
@@ -315,34 +302,11 @@ var AppMenuButton = GObject.registerClass({
}
stopAnimation() {
- if (this._stop)
- return;
-
- this._stop = true;
-
- if (this._spinner == null)
- return;
-
- Tweener.addTween(this._spinner.actor,
- { opacity: 0,
- time: SPINNER_ANIMATION_TIME,
- transition: "easeOutQuad",
- onComplete: () => {
- this._spinner.stop();
- this._spinner.actor.opacity = 255;
- this._spinner.actor.hide();
- }
- });
+ this._spinner.stop();
}
startAnimation() {
- this._stop = false;
-
- if (this._spinner == null)
- return;
-
this._spinner.play();
- this._spinner.actor.show();
}
_onAppStateChanged(appSys, app) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]