[gnome-shell/gbsneto/40-stuff: 32/68] overview: Reorganize animateTo/FromOverview()




commit d14d754736093dc5d572970c4e72c688eb46ab8a
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Jan 1 13:39:07 2021 -0300

    overview: Reorganize animateTo/FromOverview()
    
    Instead of directly accessing ViewSelector and calling these methods
    there, cascade the calls to OverviewActor, ControlsManager, and finally
    ViewSelector. Also move the opacity transition to OverviewActor.
    
    This change has no functional change.

 js/ui/overview.js         | 43 +++++++++++++++++++++++++------------------
 js/ui/overviewControls.js |  8 ++++++++
 2 files changed, 33 insertions(+), 18 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 00e998bee7..2cb5110324 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -96,6 +96,29 @@ class OverviewActor extends St.BoxLayout {
         this.add_child(this._controls);
     }
 
+    animateToOverview(onComplete) {
+        this._controls.animateToOverview();
+
+        this.opacity = 255;
+        this.ease({
+            opacity: 255,
+            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+            duration: ANIMATION_TIME,
+            onComplete,
+        });
+    }
+
+    animateFromOverview(onComplete) {
+        this._controls.animateFromOverview();
+
+        this.ease({
+            opacity: 0,
+            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
+            duration: ANIMATION_TIME,
+            onComplete,
+        });
+    }
+
     get dash() {
         return this._controls.dash;
     }
@@ -490,15 +513,7 @@ var Overview = class {
         this._activationTime = GLib.get_monotonic_time() / GLib.USEC_PER_SEC;
 
         Meta.disable_unredirect_for_display(global.display);
-        this.viewSelector.animateToOverview();
-
-        this._overview.opacity = 255;
-        this._overview.ease({
-            opacity: 255,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-            duration: ANIMATION_TIME,
-            onComplete: () => this._showDone(),
-        });
+        this._overview.animateToOverview(() => this._showDone());
 
         Main.layoutManager.overviewGroup.set_child_above_sibling(
             this._coverPane, null);
@@ -553,15 +568,7 @@ var Overview = class {
         this._animationInProgress = true;
         this._visibleTarget = false;
 
-        this.viewSelector.animateFromOverview();
-
-        // Make other elements fade out.
-        this._overview.ease({
-            opacity: 0,
-            mode: Clutter.AnimationMode.EASE_OUT_QUAD,
-            duration: ANIMATION_TIME,
-            onComplete: () => this._hideDone(),
-        });
+        this._overview.animateFromOverview(() => this._hideDone());
 
         Main.layoutManager.overviewGroup.set_child_above_sibling(
             this._coverPane, null);
diff --git a/js/ui/overviewControls.js b/js/ui/overviewControls.js
index 58442e9b5b..5927caf911 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -211,6 +211,14 @@ class ControlsManager extends St.Widget {
         this._workspaceAdjustment.value = activeIndex;
     }
 
+    animateToOverview() {
+        this.viewSelector.animateToOverview();
+    }
+
+    animateFromOverview() {
+        this.viewSelector.animateFromOverview();
+    }
+
     get searchEntry() {
         return this._searchEntry;
     }


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