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 commit has no functional change. Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1624>
This commit is contained in:
parent
e6e5a93dec
commit
0a8aeebd30
@ -97,6 +97,35 @@ class OverviewActor extends St.BoxLayout {
|
|||||||
this.add_child(this._controls);
|
this.add_child(this._controls);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
animateToOverview(callback) {
|
||||||
|
this._controls.animateToOverview();
|
||||||
|
|
||||||
|
this.opacity = 0;
|
||||||
|
this.ease({
|
||||||
|
opacity: 255,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
|
duration: ANIMATION_TIME,
|
||||||
|
onStopped: () => {
|
||||||
|
if (callback)
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
animateFromOverview(callback) {
|
||||||
|
this._controls.animateFromOverview();
|
||||||
|
|
||||||
|
this.ease({
|
||||||
|
opacity: 0,
|
||||||
|
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
||||||
|
duration: ANIMATION_TIME,
|
||||||
|
onStopped: () => {
|
||||||
|
if (callback)
|
||||||
|
callback();
|
||||||
|
},
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
get dash() {
|
get dash() {
|
||||||
return this._controls.dash;
|
return this._controls.dash;
|
||||||
}
|
}
|
||||||
@ -492,15 +521,8 @@ var Overview = class {
|
|||||||
this._activationTime = GLib.get_monotonic_time() / GLib.USEC_PER_SEC;
|
this._activationTime = GLib.get_monotonic_time() / GLib.USEC_PER_SEC;
|
||||||
|
|
||||||
Meta.disable_unredirect_for_display(global.display);
|
Meta.disable_unredirect_for_display(global.display);
|
||||||
this.viewSelector.animateToOverview();
|
|
||||||
|
|
||||||
this._overview.opacity = 0;
|
this._overview.animateToOverview(() => this._showDone());
|
||||||
this._overview.ease({
|
|
||||||
opacity: 255,
|
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
|
||||||
duration: ANIMATION_TIME,
|
|
||||||
onComplete: () => this._showDone(),
|
|
||||||
});
|
|
||||||
|
|
||||||
Main.layoutManager.overviewGroup.set_child_above_sibling(
|
Main.layoutManager.overviewGroup.set_child_above_sibling(
|
||||||
this._coverPane, null);
|
this._coverPane, null);
|
||||||
@ -555,15 +577,7 @@ var Overview = class {
|
|||||||
this._animationInProgress = true;
|
this._animationInProgress = true;
|
||||||
this._visibleTarget = false;
|
this._visibleTarget = false;
|
||||||
|
|
||||||
this.viewSelector.animateFromOverview();
|
this._overview.animateFromOverview(() => this._hideDone());
|
||||||
|
|
||||||
// Make other elements fade out.
|
|
||||||
this._overview.ease({
|
|
||||||
opacity: 0,
|
|
||||||
mode: Clutter.AnimationMode.EASE_OUT_QUAD,
|
|
||||||
duration: ANIMATION_TIME,
|
|
||||||
onComplete: () => this._hideDone(),
|
|
||||||
});
|
|
||||||
|
|
||||||
Main.layoutManager.overviewGroup.set_child_above_sibling(
|
Main.layoutManager.overviewGroup.set_child_above_sibling(
|
||||||
this._coverPane, null);
|
this._coverPane, null);
|
||||||
|
@ -172,6 +172,14 @@ class ControlsManager extends St.Widget {
|
|||||||
this._workspaceAdjustment.value = activeIndex;
|
this._workspaceAdjustment.value = activeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
animateToOverview() {
|
||||||
|
this.viewSelector.animateToOverview();
|
||||||
|
}
|
||||||
|
|
||||||
|
animateFromOverview() {
|
||||||
|
this.viewSelector.animateFromOverview();
|
||||||
|
}
|
||||||
|
|
||||||
get searchEntry() {
|
get searchEntry() {
|
||||||
return this._searchEntry;
|
return this._searchEntry;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user