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.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
This commit is contained in:
Georges Basile Stavracas Neto 2021-01-02 16:17:17 -03:00 committed by Marge Bot
parent d221215ab6
commit 22f4a6b7f6
4 changed files with 12 additions and 45 deletions

View File

@ -178,7 +178,7 @@ class ControlsManager extends St.Widget {
}
animateToOverview(callback) {
this.viewSelector.animateToOverview();
this.viewSelector.prepareToEnterOverview();
this._stateAdjustment.value = ControlsState.HIDDEN;
this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
@ -194,7 +194,7 @@ class ControlsManager extends St.Widget {
animateFromOverview(callback) {
this._ignoreShowAppsButtonToggle = true;
this.viewSelector.animateFromOverview();
this.viewSelector.prepareToLeaveOverview();
this._stateAdjustment.ease(ControlsState.HIDDEN, {
duration: Overview.ANIMATION_TIME,

View File

@ -403,10 +403,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._activitiesPage);
@ -414,8 +414,8 @@ var ViewSelector = GObject.registerClass({
Main.overview.fadeOutDesktop();
}
animateFromOverview() {
this._workspacesDisplay.animateFromOverview();
prepareToLeaveOverview() {
this._workspacesDisplay.prepareToLeaveOverview();
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
Main.overview.fadeInDesktop();

View File

@ -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 Params = imports.misc.params;
const Util = imports.misc.util;
const { WindowPreview } = imports.ui.windowPreview;
@ -1154,17 +1153,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();
@ -1178,18 +1166,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);

View File

@ -130,6 +130,7 @@ class WorkspacesView extends WorkspacesViewBase {
this._switchWorkspaceNotifyId =
global.window_manager.connect('switch-workspace',
this._activeWorkspaceChanged.bind(this));
this._updateVisibility();
}
_getFitAllBox(box, spacing, vertical) {
@ -320,11 +321,7 @@ class WorkspacesView extends WorkspacesViewBase {
return this._workspaces[active];
}
animateToOverview() {
this._updateVisibility();
}
animateFromOverview() {
prepareToLeaveOverview() {
for (let w = 0; w < this._workspaces.length; w++)
this._workspaces[w].prepareToLeaveOverview();
}
@ -487,10 +484,7 @@ class ExtraWorkspaceView extends WorkspacesViewBase {
return this._workspace;
}
animateToOverview() {
}
animateFromOverview() {
prepareToLeaveOverview() {
this._workspace.prepareToLeaveOverview();
}
@ -709,13 +703,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));
@ -726,9 +717,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();
this._leavingOverview = true;
this._updateSwipeTracker();