[gnome-shell/gbsneto/40-stuff: 37/68] workspace, workspacesView: Cleanup animation methods
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/40-stuff: 37/68] workspace, workspacesView: Cleanup animation methods
- Date: Wed, 20 Jan 2021 22:41:08 +0000 (UTC)
commit 0d74eeafef9855b137aa5c50400e27359c48499e
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Sat Jan 2 16:17:17 2021 -0300
workspace, workspacesView: Cleanup animation methods
Remove Workspace.zoomTo/FromOverview(), they're unused now. Rename
everything up to ControlsManager to prepareToEnter/LeaveOverview(),
since these classes don't run the animation anymore.
js/ui/overviewControls.js | 4 ++--
js/ui/viewSelector.js | 8 ++++----
js/ui/workspace.js | 24 ------------------------
js/ui/workspacesView.js | 21 +++++----------------
4 files changed, 11 insertions(+), 46 deletions(-)
---
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 73381144f9..961ebfcb4e 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -217,7 +217,7 @@ class ControlsManager extends St.Widget {
}
animateToOverview(onComplete) {
- this.viewSelector.animateToOverview();
+ this.viewSelector.prepareToEnterOverview();
this._adjustment.value = ControlsState.HIDDEN;
this._adjustment.ease(ControlsState.WINDOW_PICKER, {
@@ -230,7 +230,7 @@ class ControlsManager extends St.Widget {
animateFromOverview(onComplete) {
this._animating = true;
- this.viewSelector.animateFromOverview();
+ this.viewSelector.prepareToLeaveOverview();
this._adjustment.ease(ControlsState.HIDDEN, {
duration: SIDE_CONTROLS_ANIMATION_TIME,
diff --git a/js/ui/viewSelector.js b/js/ui/viewSelector.js
index 774746923c..027b6ef305 100644
--- a/js/ui/viewSelector.js
+++ b/js/ui/viewSelector.js
@@ -334,10 +334,10 @@ var ViewSelector = GObject.registerClass({
Main.overview.show();
}
- animateToOverview() {
+ prepareToEnterOverview() {
this.show();
this.reset();
- this._workspacesDisplay.animateToOverview();
+ this._workspacesDisplay.prepareToEnterOverview();
this._activePage = null;
this._showPage(this._appsPage);
@@ -345,8 +345,8 @@ var ViewSelector = GObject.registerClass({
Main.overview.fadeOutDesktop();
}
- animateFromOverview() {
- this._workspacesDisplay.animateFromOverview();
+ prepareToLeaveOverview() {
+ this._workspacesDisplay.prepareToLeaveOverview();
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
Main.overview.fadeInDesktop();
diff --git a/js/ui/workspace.js b/js/ui/workspace.js
index 0f95d2e6c5..60e0e3a6fe 100644
--- a/js/ui/workspace.js
+++ b/js/ui/workspace.js
@@ -6,7 +6,6 @@ const { Clutter, GLib, GObject, Graphene, Meta, St } = imports.gi;
const Background = imports.ui.background;
const DND = imports.ui.dnd;
const Main = imports.ui.main;
-const Overview = imports.ui.overview;
const { WindowPreview } = imports.ui.windowPreview;
var WINDOW_PREVIEW_MAXIMUM_SCALE = 0.95;
@@ -1225,17 +1224,6 @@ class Workspace extends St.Widget {
return false;
}
- zoomToOverview() {
- const animate =
- this.metaWorkspace === null || this.metaWorkspace.active;
-
- const adj = this.layout_manager.stateAdjustment;
- adj.ease(1, {
- duration: animate ? Overview.ANIMATION_TIME : 0,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- });
- }
-
prepareToLeaveOverview() {
for (let i = 0; i < this._windows.length; i++)
this._windows[i].remove_all_transitions();
@@ -1249,18 +1237,6 @@ class Workspace extends St.Widget {
this._overviewHiddenId = Main.overview.connect('hidden', this._doneLeavingOverview.bind(this));
}
- zoomFromOverview() {
- this.prepareToLeaveOverview();
-
- if (this.metaWorkspace !== null && !this.metaWorkspace.active)
- return;
-
- this.layout_manager.stateAdjustment.ease(0, {
- duration: Overview.ANIMATION_TIME,
- mode: Clutter.AnimationMode.EASE_OUT_QUAD,
- });
- }
-
_onDestroy() {
if (this._overviewHiddenId) {
Main.overview.disconnect(this._overviewHiddenId);
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 791d4b77a6..372778cbda 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -327,12 +327,7 @@ class WorkspacesView extends WorkspacesViewBase {
return this._workspaces[active];
}
- animateToOverview() {
- // Do nothing since the workspace adjustment is binded to
- // the snap adjustment
- }
-
- animateFromOverview() {
+ prepareToLeaveOverview() {
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].prepareToLeaveOverview();
}
@@ -474,10 +469,7 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
return this._workspace;
}
- animateToOverview() {
- }
-
- animateFromOverview() {
+ prepareToLeaveOverview() {
this._workspace.prepareToLeaveOverview();
}
@@ -734,13 +726,10 @@ class WorkspacesDisplay extends St.Widget {
primaryWorkspace.visible = visible;
}
- animateToOverview() {
+ prepareToEnterOverview() {
this.show();
this._updateWorkspacesViews();
- for (let i = 0; i < this._workspacesViews.length; i++)
- this._workspacesViews[i].animateToOverview();
-
this._restackedNotifyId =
Main.overview.connect('windows-restacked',
this._onRestacked.bind(this));
@@ -751,9 +740,9 @@ class WorkspacesDisplay extends St.Widget {
this._keyPressEventId = global.stage.connect('key-press-event',
this._onKeyPressEvent.bind(this));
}
- animateFromOverview() {
+ prepareToLeaveOverview() {
for (let i = 0; i < this._workspacesViews.length; i++)
- this._workspacesViews[i].animateFromOverview();
+ this._workspacesViews[i].prepareToLeaveOverview();
}
vfunc_hide() {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]