[sushi/wip/cosimoc/no-clutter: 40/66] spinnerBox: remove timeout
- From: Cosimo Cecchi <cosimoc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [sushi/wip/cosimoc/no-clutter: 40/66] spinnerBox: remove timeout
- Date: Sat, 8 Jun 2019 18:43:30 +0000 (UTC)
commit a05c3c6952cef990732bd0e9c94aab5da3948ad3
Author: Cosimo Cecchi <cosimoc gnome org>
Date: Sun Apr 9 11:54:29 2017 -0700
spinnerBox: remove timeout
We don't want to potentially show an empty window, and now that we don't
have any animations, the timeout does not make a lot of sense. Just
remove it.
src/js/ui/mainWindow.js | 2 +-
src/js/ui/spinnerBox.js | 26 ++++----------------------
2 files changed, 5 insertions(+), 23 deletions(-)
---
diff --git a/src/js/ui/mainWindow.js b/src/js/ui/mainWindow.js
index 2e6436e..e1e52a5 100644
--- a/src/js/ui/mainWindow.js
+++ b/src/js/ui/mainWindow.js
@@ -173,7 +173,7 @@ var MainWindow = new Lang.Class({
* if the loading takes too long.
*/
this._renderer = new SpinnerBox.SpinnerBox();
- this._renderer.startTimeout();
+ this._renderer.start();
file.query_info_async
(Gio.FILE_ATTRIBUTE_STANDARD_DISPLAY_NAME + ',' +
diff --git a/src/js/ui/spinnerBox.js b/src/js/ui/spinnerBox.js
index 2d2475f..1d00cfe 100644
--- a/src/js/ui/spinnerBox.js
+++ b/src/js/ui/spinnerBox.js
@@ -28,17 +28,13 @@ const _ = Gettext.gettext;
const Gtk = imports.gi.Gtk;
const Lang = imports.lang;
-const Mainloop = imports.mainloop;
let SPINNER_SIZE = 48;
-let TIMEOUT = 500;
var SpinnerBox = new Lang.Class({
Name: 'SpinnerBox',
_init : function(args) {
- this._timeoutId = 0;
-
this.canFullScreen = false;
this.moveOnClick = true;
@@ -52,6 +48,8 @@ var SpinnerBox = new Lang.Class({
spacing: 12 });
this._spinnerBox.pack_start(this._spinner, true, true, 0);
this._spinnerBox.pack_start(this._label, true, true, 0);
+
+ this._spinnerBox.show_all();
},
render : function() {
@@ -64,27 +62,11 @@ var SpinnerBox = new Lang.Class({
spinnerSize[0].height ];
},
- startTimeout : function() {
- if (this._timeoutId)
- return;
-
+ start : function() {
this._spinner.start();
- this._timeoutId = Mainloop.timeout_add(TIMEOUT,
- Lang.bind(this,
- this._onTimeoutCompleted));
},
destroy : function() {
- if (this._timeoutId) {
- Mainloop.source_remove(this._timeoutId);
- this._timeoutId = 0;
- }
-
this._spinnerBox.destroy();
- },
-
- _onTimeoutCompleted : function() {
- this._timeoutId = 0;
- this._spinnerBox.show_all();
- },
+ }
});
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]