overview: Update animation

Update the animation on entering/leaving the overview to only zoom
the window previews and fade other elements.

https://bugzilla.gnome.org/show_bug.cgi?id=634948
This commit is contained in:
Florian Müllner 2010-11-11 18:50:19 +01:00
parent 1bbc138ed2
commit a66af6fbac

View File

@ -214,6 +214,9 @@ Overview.prototype = {
let contentY = Panel.PANEL_HEIGHT; let contentY = Panel.PANEL_HEIGHT;
let contentHeight = primary.height - contentY - Main.messageTray.actor.height; let contentHeight = primary.height - contentY - Main.messageTray.actor.height;
this._group.set_position(primary.x, primary.y);
this._group.set_size(primary.width, primary.height);
this._coverPane.set_position(0, contentY); this._coverPane.set_position(0, contentY);
this._coverPane.set_size(primary.width, contentHeight); this._coverPane.set_size(primary.width, contentHeight);
@ -272,12 +275,12 @@ Overview.prototype = {
// Returns the current scale of the Overview. // Returns the current scale of the Overview.
getScale : function() { getScale : function() {
return this._group.scaleX; return this.workspaces.actor.scaleX;
}, },
// Returns the current position of the Overview. // Returns the current position of the Overview.
getPosition : function() { getPosition : function() {
return [this._group.x, this._group.y]; return [this.workspaces.actor.x, this.workspaces.actor.y];
}, },
show : function() { show : function() {
@ -305,7 +308,7 @@ Overview.prototype = {
this._dash.show(); this._dash.show();
this.workspaces = this._workspacesDisplay.workspacesView; this.workspaces = this._workspacesDisplay.workspacesView;
this._group.add_actor(this.workspaces.actor); global.overlay_group.add_actor(this.workspaces.actor);
if (!this._desktopFade.child) if (!this._desktopFade.child)
this._desktopFade.child = this._getDesktopClone(); this._desktopFade.child = this._getDesktopClone();
@ -320,16 +323,16 @@ Overview.prototype = {
}); });
} }
// Create a zoom out effect. First scale the Overview group up and // Create a zoom out effect. First scale the workspaces view up and
// position it so that the active workspace fills up the whole screen, // position it so that the active workspace fills up the whole screen,
// then transform the group to its normal dimensions and position. // then transform it to its normal dimensions and position.
// The opposite transition is used in hide(). // The opposite transition is used in hide().
this._group.scaleX = this._group.scaleY = this.getZoomedInScale(); this.workspaces.actor.scaleX = this.workspaces.actor.scaleY = this.getZoomedInScale();
[this._group.x, this._group.y] = this.getZoomedInPosition(); [this.workspaces.actor.x, this.workspaces.actor.y] = this.getZoomedInPosition();
let primary = global.get_primary_monitor(); let primary = global.get_primary_monitor();
Tweener.addTween(this._group, Tweener.addTween(this.workspaces.actor,
{ x: primary.x, { x: primary.x - this._group.x,
y: primary.y, y: primary.y - this._group.y,
scaleX: 1, scaleX: 1,
scaleY: 1, scaleY: 1,
transition: 'easeOutQuad', transition: 'easeOutQuad',
@ -338,9 +341,9 @@ Overview.prototype = {
onCompleteScope: this onCompleteScope: this
}); });
// Make Dash fade in so that it doesn't appear too big. // Make the other elements fade in.
this._dash.actor.opacity = 0; this._group.opacity = 0;
Tweener.addTween(this._dash.actor, Tweener.addTween(this._group,
{ opacity: 255, { opacity: 255,
transition: 'easeOutQuad', transition: 'easeOutQuad',
time: ANIMATION_TIME time: ANIMATION_TIME
@ -368,12 +371,12 @@ Overview.prototype = {
this.workspaces.hide(); this.workspaces.hide();
// Create a zoom in effect by transforming the Overview group so that // Create a zoom in effect by transforming the workspaces view so that
// the active workspace fills up the whole screen. The opposite // the active workspace fills up the whole screen. The opposite
// transition is used in show(). // transition is used in show().
let scale = this.getZoomedInScale(); let scale = this.getZoomedInScale();
let [posX, posY] = this.getZoomedInPosition(); let [posX, posY] = this.getZoomedInPosition();
Tweener.addTween(this._group, Tweener.addTween(this.workspaces.actor,
{ x: posX, { x: posX,
y: posY, y: posY,
scaleX: scale, scaleX: scale,
@ -384,8 +387,8 @@ Overview.prototype = {
onCompleteScope: this onCompleteScope: this
}); });
// Make Dash fade out so that it doesn't appear to big. // Make other elements fade out.
Tweener.addTween(this._dash.actor, Tweener.addTween(this._group,
{ opacity: 0, { opacity: 0,
transition: 'easeOutQuad', transition: 'easeOutQuad',
time: ANIMATION_TIME time: ANIMATION_TIME
@ -441,14 +444,6 @@ Overview.prototype = {
this._background.hide(); this._background.hide();
this._group.hide(); this._group.hide();
// Reset the overview actor's scale/position, so that other elements
// can calculate their position correctly the next time the overview
// is shown
let primary = global.get_primary_monitor();
this._group.set_scale(1, 1);
this._group.set_position(primary.x, primary.y);
this._group.set_size(primary.width, primary.height);
this.visible = false; this.visible = false;
this.animationInProgress = false; this.animationInProgress = false;
this._hideInProgress = false; this._hideInProgress = false;