[gnome-shell] workspace: Rename some variables for clarity
- From: Florian Müllner <fmuellner src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell] workspace: Rename some variables for clarity
- Date: Thu, 31 Jan 2019 17:47:13 +0000 (UTC)
commit a00b967df003cc89fa0f55fa5eaf59f3e1a0067a
Author: verdre <verdre v0yd nl>
Date: Wed Jan 30 20:54:44 2019 +0100
workspace: Rename some variables for clarity
Since the overlays we show on hover above the window clones are no
longer only a close button, but the window title, a border and a close
button, rename a few variables so it's easier to understand what they're
for.
https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/346
js/ui/workspace.js | 36 ++++++++++++++++++------------------
1 file changed, 18 insertions(+), 18 deletions(-)
---
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 6e3be18a6..00c5330ab 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -23,7 +23,7 @@ var WINDOW_DND_SIZE = 256;
var WINDOW_CLONE_MAXIMUM_SCALE = 1.0;
var WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT = 750;
-var CLOSE_BUTTON_FADE_TIME = 0.1;
+var WINDOW_OVERLAY_FADE_TIME = 0.1;
var WINDOW_REPOSITIONING_DELAY = 750;
@@ -473,7 +473,7 @@ var WindowOverlay = class {
button.add_actor(new St.Icon({ icon_name: 'window-close-symbolic' }));
button._overlap = 0;
- this._idleToggleCloseId = 0;
+ this._idleHideOverlayId = 0;
button.connect('clicked', () => this._windowClone.deleteAll());
windowClone.actor.connect('destroy', this._onDestroy.bind(this));
@@ -507,7 +507,7 @@ var WindowOverlay = class {
hide() {
this._hidden = true;
- this.hideCloseButton();
+ this.hideOverlay();
}
show() {
@@ -626,9 +626,9 @@ var WindowOverlay = class {
}
_onDestroy() {
- if (this._idleToggleCloseId > 0) {
- Mainloop.source_remove(this._idleToggleCloseId);
- this._idleToggleCloseId = 0;
+ if (this._idleHideOverlayId > 0) {
+ Mainloop.source_remove(this._idleHideOverlayId);
+ this._idleHideOverlayId = 0;
}
this._windowClone.metaWindow.disconnect(this._updateCaptionId);
this.title.destroy();
@@ -648,7 +648,7 @@ var WindowOverlay = class {
a.opacity = 0;
Tweener.addTween(a,
{ opacity: 255,
- time: CLOSE_BUTTON_FADE_TIME,
+ time: WINDOW_OVERLAY_FADE_TIME,
transition: 'easeOutQuad' });
});
}
@@ -658,7 +658,7 @@ var WindowOverlay = class {
a.opacity = 255;
Tweener.addTween(a,
{ opacity: 0,
- time: CLOSE_BUTTON_FADE_TIME,
+ time: WINDOW_OVERLAY_FADE_TIME,
transition: 'easeInQuad' });
});
}
@@ -676,14 +676,14 @@ var WindowOverlay = class {
}
_onHideChrome() {
- if (this._idleToggleCloseId == 0) {
- this._idleToggleCloseId = Mainloop.timeout_add(WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT,
this._idleToggleCloseButton.bind(this));
- GLib.Source.set_name_by_id(this._idleToggleCloseId, '[gnome-shell] this._idleToggleCloseButton');
+ if (this._idleHideOverlayId == 0) {
+ this._idleHideOverlayId = Mainloop.timeout_add(WINDOW_OVERLAY_IDLE_HIDE_TIMEOUT,
this._idleHideOverlay.bind(this));
+ GLib.Source.set_name_by_id(this._idleHideOverlayId, '[gnome-shell] this._idleHideOverlay');
}
}
- _idleToggleCloseButton() {
- this._idleToggleCloseId = 0;
+ _idleHideOverlay() {
+ this._idleHideOverlayId = 0;
if (!this._windowClone.actor['has-pointer'] &&
!this.closeButton['has-pointer'])
@@ -692,10 +692,10 @@ var WindowOverlay = class {
return GLib.SOURCE_REMOVE;
}
- hideCloseButton() {
- if (this._idleToggleCloseId > 0) {
- Mainloop.source_remove(this._idleToggleCloseId);
- this._idleToggleCloseId = 0;
+ hideOverlay() {
+ if (this._idleHideOverlayId > 0) {
+ Mainloop.source_remove(this._idleHideOverlayId);
+ this._idleHideOverlayId = 0;
}
this.closeButton.hide();
this.border.hide();
@@ -1892,7 +1892,7 @@ var Workspace = class {
let overlay = this._windowOverlays[i];
if (overlay == windowOverlay)
continue;
- overlay.hideCloseButton();
+ overlay.hideOverlay();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]