From b8b8919563c7c371d633a98f52a0686731be5aa4 Mon Sep 17 00:00:00 2001 From: Alessandro Bono Date: Mon, 21 Nov 2022 12:32:05 +0100 Subject: [PATCH] overviewControls: Group prepare to enter/leave overview code Move preparation code into their own functions. These functions will be used in order to separate the animation control into two steps. Part-of: --- js/ui/overviewControls.js | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js index fa8202ee8..870cf11be 100644 --- a/js/ui/overviewControls.js +++ b/js/ui/overviewControls.js @@ -715,11 +715,19 @@ class ControlsManager extends St.Widget { this._workspacesDisplay.hide(); } + prepareToEnterOverview() { + this._searchController.prepareToEnterOverview(); + this._workspacesDisplay.prepareToEnterOverview(); + } + + prepareToLeaveOverview() { + this._workspacesDisplay.prepareToLeaveOverview(); + } + animateToOverview(state, callback) { this._ignoreShowAppsButtonToggle = true; - this._searchController.prepareToEnterOverview(); - this._workspacesDisplay.prepareToEnterOverview(); + this.prepareToEnterOverview(); this._stateAdjustment.value = ControlsState.HIDDEN; this._stateAdjustment.ease(state, { @@ -740,7 +748,7 @@ class ControlsManager extends St.Widget { animateFromOverview(callback) { this._ignoreShowAppsButtonToggle = true; - this._workspacesDisplay.prepareToLeaveOverview(); + this.prepareToLeaveOverview(); this._stateAdjustment.ease(ControlsState.HIDDEN, { duration: Overview.ANIMATION_TIME, @@ -775,8 +783,7 @@ class ControlsManager extends St.Widget { this._stateAdjustment.remove_transition('value'); tracker.confirmSwipe(baseDistance, points, progress, cancelProgress); - this._workspacesDisplay.prepareToEnterOverview(); - this._searchController.prepareToEnterOverview(); + this.prepareToEnterOverview(); this._stateAdjustment.gestureInProgress = true; } @@ -786,7 +793,7 @@ class ControlsManager extends St.Widget { gestureEnd(target, duration, onComplete) { if (target === ControlsState.HIDDEN) - this._workspacesDisplay.prepareToLeaveOverview(); + this.prepareToLeaveOverview(); this.dash.showAppsButton.checked = target === ControlsState.APP_GRID; @@ -804,8 +811,7 @@ class ControlsManager extends St.Widget { async runStartupAnimation(callback) { this._ignoreShowAppsButtonToggle = true; - this._searchController.prepareToEnterOverview(); - this._workspacesDisplay.prepareToEnterOverview(); + this.prepareToEnterOverview(); this._stateAdjustment.value = ControlsState.HIDDEN; this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {