[gnome-shell/gbsneto/40-stuff: 39/68] overivew: Propagate target state when animating to overview
- From: Georges Basile Stavracas Neto <gbsneto src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-shell/gbsneto/40-stuff: 39/68] overivew: Propagate target state when animating to overview
- Date: Wed, 20 Jan 2021 22:41:08 +0000 (UTC)
commit 4207e8c26ee477590480792dfedfc1482df5de07
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 factor out Overview.show() in a new private function _show() so
that we can reuse it next commits.
js/ui/overview.js | 14 +++++++++-----
js/ui/overviewControls.js | 4 ++--
2 files changed, 11 insertions(+), 7 deletions(-)
---
diff --git a/js/ui/overview.js b/js/ui/overview.js
index 2577b691c6..00d8d69212 100644
--- a/js/ui/overview.js
+++ b/js/ui/overview.js
@@ -97,8 +97,8 @@ class OverviewActor extends St.BoxLayout {
this.add_child(this._controls);
}
- animateToOverview(onComplete) {
- this._controls.animateToOverview(onComplete);
+ animateToOverview(state, onComplete) {
+ this._controls.animateToOverview(state, onComplete);
}
animateFromOverview(onComplete) {
@@ -481,6 +481,10 @@ var Overview = class {
//
// Animates the overview visible and grabs mouse and keyboard input
show() {
+ this._show(OverviewControls.ControlsState.WINDOW_PICKER);
+ }
+
+ _show(state) {
if (this.isDummy)
return;
if (this._shown)
@@ -491,11 +495,11 @@ var Overview = class {
return;
Main.layoutManager.showOverview();
- this._animateVisible();
+ this._animateVisible(state);
}
- _animateVisible() {
+ _animateVisible(state) {
if (this._visible || this._animationInProgress)
return;
@@ -505,7 +509,7 @@ var Overview = class {
this._activationTime = GLib.get_monotonic_time() / GLib.USEC_PER_SEC;
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 961ebfcb4e..1495a7e32e 100644
--- a/js/ui/overviewControls.js
+++ b/js/ui/overviewControls.js
@@ -216,11 +216,11 @@ class ControlsManager extends St.Widget {
this._workspaceAdjustment.value = activeIndex;
}
- animateToOverview(onComplete) {
+ animateToOverview(state, onComplete) {
this.viewSelector.prepareToEnterOverview();
this._adjustment.value = ControlsState.HIDDEN;
- this._adjustment.ease(ControlsState.WINDOW_PICKER, {
+ this._adjustment.ease(state, {
duration: SIDE_CONTROLS_ANIMATION_TIME,
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
onComplete,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]