[gnome-shell] overivew: Propagate target state when animating to overview



commit 8089d7cbf7a1e65ab707d4cf193baa11dd74a81c
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Sat Jan 2 17:19:37 2021 -0300

    overivew: Propagate target state when animating to overview
    
    Next commits will requires ControlsManager to animate to different
    states, depending on how Overview is called. Add a new 'state'
    parameter to ControlsManager's, and OverviewActor's animateToOverview,
    and Overview.show().
    
    Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>

 js/ui/overview.js         | 15 +++++++++------
 js/ui/overviewControls.js |  4 ++--
 2 files changed, 11 insertions(+), 8 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 9e76a82f80..0020dcd4f2 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -98,8 +98,8 @@ class OverviewActor extends St.BoxLayout {
         this.add_child(this._controls);
     }
 
-    animateToOverview(callback) {
-        this._controls.animateToOverview(callback);
+    animateToOverview(state, callback) {
+        this._controls.animateToOverview(state, callback);
     }
 
     animateFromOverview(callback) {
@@ -482,7 +482,10 @@ var Overview = class {
     // show:
     //
     // Animates the overview visible and grabs mouse and keyboard input
-    show() {
+    show(state = OverviewControls.ControlsState.WINDOW_PICKER) {
+        if (state === OverviewControls.ControlsState.HIDDEN)
+            throw new Error('Invalid state, use hide() to hide');
+
         if (this.isDummy)
             return;
         if (this._shown)
@@ -493,11 +496,11 @@ var Overview = class {
             return;
 
         Main.layoutManager.showOverview();
-        this._animateVisible();
+        this._animateVisible(state);
     }
 
 
-    _animateVisible() {
+    _animateVisible(state) {
         if (this._visible || this._animationInProgress)
             return;
 
@@ -508,7 +511,7 @@ var Overview = class {
 
         Meta.disable_unredirect_for_display(global.display);
 
-        this._overview.animateToOverview(() => this._showDone());
+        this._overview.animateToOverview(state, () => this._showDone());
 
         Main.layoutManager.overviewGroup.set_child_above_sibling(
             this._coverPane, null);
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 9dbda14597..2f584d2090 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -177,11 +177,11 @@ class ControlsManager extends St.Widget {
         this._workspaceAdjustment.value = activeIndex;
     }
 
-    animateToOverview(callback) {
+    animateToOverview(state, callback) {
         this.viewSelector.prepareToEnterOverview();
 
         this._stateAdjustment.value = ControlsState.HIDDEN;
-        this._stateAdjustment.ease(ControlsState.WINDOW_PICKER, {
+        this._stateAdjustment.ease(state, {
             duration: Overview.ANIMATION_TIME,
             mode: Clutter.AnimationMode.EASE_OUT_QUAD,
             onStopped: () => {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]