[gnome-shell/wip/jimmac/dash-icon-spacing: 69/72] workspacesView: Use calculated workspace state for progress
- From: Jakub Steiner <jimmac src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/wip/jimmac/dash-icon-spacing: 69/72] workspacesView: Use calculated workspace state for progress
- Date: Tue, 2 Feb 2021 11:58:19 +0000 (UTC)
commit b942e869f5cc79ebb8be98d25f422f56c982d7db
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date: Fri Jan 15 15:58:33 2021 -0300
workspacesView: Use calculated workspace state for progress
It works just like before, except that this has the nice side effect
of not changing the workspace mode when leaving the overview from
the app grid state.
js/ui/workspacesView.js | 23 +++++++++++++++++++----
1 file changed, 19 insertions(+), 4 deletions(-)
---
diff --git a/js/ui/workspacesView.js b/js/ui/workspacesView.js
index 0ceab32655..be4621c6da 100644
--- a/js/ui/workspacesView.js
+++ b/js/ui/workspacesView.js
@@ -330,13 +330,28 @@ class WorkspacesView extends WorkspacesViewBase {
});
}
+ _getWorkspaceModeForOverviewState(state) {
+ switch (state) {
+ case OverviewControls.ControlsState.HIDDEN:
+ return 0;
+ case OverviewControls.ControlsState.WINDOW_PICKER:
+ return 1;
+ case OverviewControls.ControlsState.APP_GRID:
+ return 0;
+ }
+
+ return 0;
+ }
+
_updateWorkspacesState() {
const snapProgress = this._snapAdjustment.value;
- const overviewState = this._overviewAdjustment.value;
+ const [, initialState, finalState, progress] =
+ this._overviewAdjustment.getState();
- const normalizedWorkspaceState = 1 - Math.min(1,
- Math.abs(OverviewControls.ControlsState.WINDOW_PICKER - overviewState));
- const workspaceMode = Math.interpolate(0, normalizedWorkspaceState, snapProgress);
+ const workspaceMode = snapProgress * Math.interpolate(
+ this._getWorkspaceModeForOverviewState(initialState),
+ this._getWorkspaceModeForOverviewState(finalState),
+ progress);
this._workspaces.forEach((w, index) => {
// Workspace mode
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]