[sushi/wip/cosimoc/no-clutter: 8/36] spinnerBox: return a GtkWidget
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/wip/cosimoc/no-clutter: 8/36] spinnerBox: return a GtkWidget
- Date: Mon, 3 Apr 2017 20:04:11 +0000 (UTC)
commit 8d4a780afa9fa93a6f5121db2639383ed92c9759
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Mon Apr 3 12:36:50 2017 -0700
spinnerBox: return a GtkWidget
src/js/ui/spinnerBox.js | 35 +++++++----------------------------
1 files changed, 7 insertions(+), 28 deletions(-)
---
diff --git a/src/js/ui/spinnerBox.js b/src/js/ui/spinnerBox.js
index e0979d7..39da3ce 100644
--- a/src/js/ui/spinnerBox.js
+++ b/src/js/ui/spinnerBox.js
@@ -26,9 +26,7 @@
const Gettext = imports.gettext.domain('sushi');
const _ = Gettext.gettext;
const Gtk = imports.gi.Gtk;
-const GtkClutter = imports.gi.GtkClutter;
-const Tweener = imports.ui.tweener;
const Lang = imports.lang;
const Mainloop = imports.mainloop;
@@ -44,26 +42,20 @@ const SpinnerBox = new Lang.Class({
this.canFullScreen = false;
this.moveOnClick = true;
- this._spinnerBox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
- spacing: 12 });
- this._spinnerBox.show();
-
this._spinner = new Gtk.Spinner();
- this._spinner.show();
this._spinner.set_size_request(SPINNER_SIZE, SPINNER_SIZE);
- this._spinnerBox.pack_start(this._spinner, true, true, 0);
this._label = new Gtk.Label();
this._label.set_text(_("Loading…"));
- this._label.show();
- this._spinnerBox.pack_start(this._label, true, true, 0);
- this.actor = new GtkClutter.Actor({ contents: this._spinnerBox });
- this.actor.set_opacity(0);
+ this._spinnerBox = new Gtk.Box({ orientation: Gtk.Orientation.VERTICAL,
+ spacing: 12 });
+ this._spinnerBox.pack_start(this._spinner, true, true, 0);
+ this._spinnerBox.pack_start(this._label, true, true, 0);
},
render : function() {
- return this.actor;
+ return this._spinnerBox;
},
getSizeForAllocation : function() {
@@ -88,24 +80,11 @@ const SpinnerBox = new Lang.Class({
this._timeoutId = 0;
}
- Tweener.addTween(this.actor,
- { opacity: 0,
- time: 0.15,
- transition: 'easeOutQuad',
- onComplete: function() {
- this.actor.destroy();
- },
- onCompleteScope: this
- });
+ this._spinnerBox.destroy();
},
_onTimeoutCompleted : function() {
this._timeoutId = 0;
-
- Tweener.addTween(this.actor,
- { opacity: 255,
- time: 0.3,
- transition: 'easeOutQuad'
- });
+ this._spinnerBox.show_all();
},
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]