overview: new transition
This commit is contained in:
parent
51e63233ce
commit
1afb04d1e4
@ -622,7 +622,7 @@ const Overview = new Lang.Class({
|
|||||||
this.animationInProgress = true;
|
this.animationInProgress = true;
|
||||||
this.visibleTarget = false;
|
this.visibleTarget = false;
|
||||||
|
|
||||||
this.viewSelector.zoomFromOverview();
|
this.viewSelector.leaveOverview();
|
||||||
|
|
||||||
// Make other elements fade out.
|
// Make other elements fade out.
|
||||||
Tweener.addTween(this._stack,
|
Tweener.addTween(this._stack,
|
||||||
|
@ -118,13 +118,11 @@ const ViewSelector = new Lang.Class({
|
|||||||
this._stageKeyPressId = 0;
|
this._stageKeyPressId = 0;
|
||||||
Main.overview.connect('showing', Lang.bind(this,
|
Main.overview.connect('showing', Lang.bind(this,
|
||||||
function () {
|
function () {
|
||||||
this._showAppsButton.checked = false;
|
|
||||||
this._stageKeyPressId = global.stage.connect('key-press-event',
|
this._stageKeyPressId = global.stage.connect('key-press-event',
|
||||||
Lang.bind(this, this._onStageKeyPress));
|
Lang.bind(this, this._onStageKeyPress));
|
||||||
}));
|
}));
|
||||||
Main.overview.connect('hiding', Lang.bind(this,
|
Main.overview.connect('hiding', Lang.bind(this,
|
||||||
function () {
|
function () {
|
||||||
this._showAppsButton.checked = false;
|
|
||||||
if (this._stageKeyPressId != 0) {
|
if (this._stageKeyPressId != 0) {
|
||||||
global.stage.disconnect(this._stageKeyPressId);
|
global.stage.disconnect(this._stageKeyPressId);
|
||||||
this._stageKeyPressId = 0;
|
this._stageKeyPressId = 0;
|
||||||
@ -160,6 +158,11 @@ const ViewSelector = new Lang.Class({
|
|||||||
show: function() {
|
show: function() {
|
||||||
this.reset();
|
this.reset();
|
||||||
|
|
||||||
|
this._showAppsBlocked = true;
|
||||||
|
this._showAppsButton.checked = false;
|
||||||
|
this._showAppsBlocked = false;
|
||||||
|
|
||||||
|
this._workspacesPage.opacity = 255;
|
||||||
this._workspacesDisplay.show();
|
this._workspacesDisplay.show();
|
||||||
this._activePage = null;
|
this._activePage = null;
|
||||||
this._syncActivePage();
|
this._syncActivePage();
|
||||||
@ -168,11 +171,13 @@ const ViewSelector = new Lang.Class({
|
|||||||
Main.overview.fadeOutDesktop();
|
Main.overview.fadeOutDesktop();
|
||||||
},
|
},
|
||||||
|
|
||||||
zoomFromOverview: function() {
|
leaveOverview: function() {
|
||||||
this._workspacesDisplay.zoomFromOverview();
|
|
||||||
|
|
||||||
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
|
if (!this._workspacesDisplay.activeWorkspaceHasMaximizedWindows())
|
||||||
Main.overview.fadeInDesktop();
|
Main.overview.fadeInDesktop();
|
||||||
|
|
||||||
|
// If we're not on the windows page, don't zoom back the primary monitor.
|
||||||
|
let zoomPrimary = (this._activePage == this._workspacesPage);
|
||||||
|
this._workspacesDisplay.leaveOverview(zoomPrimary);
|
||||||
},
|
},
|
||||||
|
|
||||||
setWorkspacesFullGeometry: function(geom) {
|
setWorkspacesFullGeometry: function(geom) {
|
||||||
@ -181,6 +186,9 @@ const ViewSelector = new Lang.Class({
|
|||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
this._workspacesDisplay.hide();
|
this._workspacesDisplay.hide();
|
||||||
|
if (this._activePage)
|
||||||
|
this._activePage.hide();
|
||||||
|
this._activePage = null;
|
||||||
},
|
},
|
||||||
|
|
||||||
_addPage: function(actor, name, a11yIcon, params) {
|
_addPage: function(actor, name, a11yIcon, params) {
|
||||||
@ -215,13 +223,13 @@ const ViewSelector = new Lang.Class({
|
|||||||
this._activePage.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
this._activePage.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
|
||||||
this._activePage.show();
|
this._activePage.show();
|
||||||
Tweener.addTween(this._activePage,
|
Tweener.addTween(this._activePage,
|
||||||
{ opacity: 255,
|
{ opacity: 255,
|
||||||
time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME,
|
time: OverviewControls.SIDE_CONTROLS_ANIMATION_TIME,
|
||||||
transition: 'easeOutQuad'
|
transition: 'easeOutQuad'
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
_showPage: function(page) {
|
_setActivePage: function(page) {
|
||||||
if (page == this._activePage)
|
if (page == this._activePage)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@ -261,11 +269,12 @@ const ViewSelector = new Lang.Class({
|
|||||||
let activePage = this._getActivePage();
|
let activePage = this._getActivePage();
|
||||||
if (activePage == this._activePage)
|
if (activePage == this._activePage)
|
||||||
return;
|
return;
|
||||||
this._showPage(activePage);
|
this._setActivePage(activePage);
|
||||||
},
|
},
|
||||||
|
|
||||||
_onShowAppsButtonToggled: function() {
|
_onShowAppsButtonToggled: function() {
|
||||||
this._syncActivePage();
|
if (!this._showAppsBlocked)
|
||||||
|
this._syncActivePage();
|
||||||
},
|
},
|
||||||
|
|
||||||
_onStageKeyPress: function(actor, event) {
|
_onStageKeyPress: function(actor, event) {
|
||||||
|
@ -1521,34 +1521,39 @@ const Workspace = new Lang.Class({
|
|||||||
this._recalculateWindowPositions(WindowPositionFlags.ANIMATE | WindowPositionFlags.INITIAL);
|
this._recalculateWindowPositions(WindowPositionFlags.ANIMATE | WindowPositionFlags.INITIAL);
|
||||||
},
|
},
|
||||||
|
|
||||||
// Animates the return from Overview mode
|
_leavingOverview: function() {
|
||||||
zoomFromOverview : function() {
|
|
||||||
let currentWorkspace = global.screen.get_active_workspace();
|
let currentWorkspace = global.screen.get_active_workspace();
|
||||||
|
if (this.metaWorkspace != null && this.metaWorkspace != currentWorkspace)
|
||||||
|
return false;
|
||||||
|
|
||||||
this.leavingOverview = true;
|
this.leavingOverview = true;
|
||||||
|
this._overviewHiddenId = Main.overview.connect('hidden', Lang.bind(this,
|
||||||
|
this._doneLeavingOverview));
|
||||||
|
|
||||||
for (let i = 0; i < this._windows.length; i++) {
|
for (let i = 0; i < this._windows.length; i++) {
|
||||||
let clone = this._windows[i];
|
let clone = this._windows[i];
|
||||||
Tweener.removeTweens(clone.actor);
|
Tweener.removeTweens(clone.actor);
|
||||||
|
|
||||||
|
let overlay = this._windowOverlays[i];
|
||||||
|
if (overlay)
|
||||||
|
overlay.hide();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this._repositionWindowsId > 0) {
|
if (this._repositionWindowsId > 0) {
|
||||||
Mainloop.source_remove(this._repositionWindowsId);
|
Mainloop.source_remove(this._repositionWindowsId);
|
||||||
this._repositionWindowsId = 0;
|
this._repositionWindowsId = 0;
|
||||||
}
|
}
|
||||||
this._overviewHiddenId = Main.overview.connect('hidden', Lang.bind(this,
|
|
||||||
this._doneLeavingOverview));
|
|
||||||
|
|
||||||
if (this.metaWorkspace != null && this.metaWorkspace != currentWorkspace)
|
return true;
|
||||||
|
},
|
||||||
|
|
||||||
|
// Animates the return from Overview mode
|
||||||
|
zoomFromOverview : function() {
|
||||||
|
if (!this._leavingOverview())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// Position and scale the windows.
|
|
||||||
for (let i = 0; i < this._windows.length; i++) {
|
for (let i = 0; i < this._windows.length; i++) {
|
||||||
let clone = this._windows[i];
|
let clone = this._windows[i];
|
||||||
let overlay = this._windowOverlays[i];
|
|
||||||
|
|
||||||
if (overlay)
|
|
||||||
overlay.hide();
|
|
||||||
|
|
||||||
if (clone.metaWindow.showing_on_its_workspace()) {
|
if (clone.metaWindow.showing_on_its_workspace()) {
|
||||||
let [origX, origY] = clone.getOriginalPosition();
|
let [origX, origY] = clone.getOriginalPosition();
|
||||||
@ -1575,6 +1580,31 @@ const Workspace = new Lang.Class({
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fadeFromOverview: function() {
|
||||||
|
if (!this._leavingOverview())
|
||||||
|
return;
|
||||||
|
|
||||||
|
for (let i = 0; i < this._windows.length; i++) {
|
||||||
|
let clone = this._windows[i];
|
||||||
|
|
||||||
|
if (clone.metaWindow.showing_on_its_workspace()) {
|
||||||
|
clone.actor.x = clone.origX;
|
||||||
|
clone.actor.y = clone.origY;
|
||||||
|
clone.actor.scale_x = 1.0;
|
||||||
|
clone.actor.scale_y = 1.0;
|
||||||
|
clone.actor.opacity = 0;
|
||||||
|
|
||||||
|
Tweener.addTween(clone.actor,
|
||||||
|
{ opacity: 255,
|
||||||
|
time: Overview.ANIMATION_TIME,
|
||||||
|
transition: 'easeOutQuad'
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
clone.actor.hide();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
destroy : function() {
|
destroy : function() {
|
||||||
this.actor.destroy();
|
this.actor.destroy();
|
||||||
},
|
},
|
||||||
|
@ -145,11 +145,22 @@ const WorkspacesView = new Lang.Class({
|
|||||||
this._updateWorkspaceActors(false);
|
this._updateWorkspaceActors(false);
|
||||||
},
|
},
|
||||||
|
|
||||||
zoomFromOverview: function() {
|
_leaveOverview: function() {
|
||||||
this.actor.remove_clip();
|
this.actor.remove_clip();
|
||||||
|
},
|
||||||
|
|
||||||
for (let w = 0; w < this._workspaces.length; w++)
|
zoomFromOverview: function() {
|
||||||
this._workspaces[w].zoomFromOverview();
|
this._leaveOverview();
|
||||||
|
this._workspaces.forEach(function(w) {
|
||||||
|
w.zoomFromOverview();
|
||||||
|
});
|
||||||
|
},
|
||||||
|
|
||||||
|
fadeFromOverview: function() {
|
||||||
|
this._leaveOverview();
|
||||||
|
this._workspaces.forEach(function(w) {
|
||||||
|
w.fadeFromOverview();
|
||||||
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
syncStacking: function(stackIndices) {
|
syncStacking: function(stackIndices) {
|
||||||
@ -365,6 +376,10 @@ const ExtraWorkspaceView = new Lang.Class({
|
|||||||
this._workspace.zoomFromOverview();
|
this._workspace.zoomFromOverview();
|
||||||
},
|
},
|
||||||
|
|
||||||
|
fadeFromOverview: function() {
|
||||||
|
this._workspace.fadeFromOverview();
|
||||||
|
},
|
||||||
|
|
||||||
syncStacking: function(stackIndices) {
|
syncStacking: function(stackIndices) {
|
||||||
this._workspace.syncStacking(stackIndices);
|
this._workspace.syncStacking(stackIndices);
|
||||||
},
|
},
|
||||||
@ -466,9 +481,18 @@ const WorkspacesDisplay = new Lang.Class({
|
|||||||
this._scrollEventId = Main.overview.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
this._scrollEventId = Main.overview.connect('scroll-event', Lang.bind(this, this._onScrollEvent));
|
||||||
},
|
},
|
||||||
|
|
||||||
zoomFromOverview: function() {
|
leaveOverview: function(zoomPrimary) {
|
||||||
for (let i = 0; i < this._workspacesViews.length; i++)
|
for (let i = 0; i < this._workspacesViews.length; i++) {
|
||||||
this._workspacesViews[i].zoomFromOverview();
|
let view = this._workspacesViews[i];
|
||||||
|
if (i == this._primaryIndex) {
|
||||||
|
if (zoomPrimary)
|
||||||
|
view.zoomFromOverview();
|
||||||
|
else
|
||||||
|
view.fadeFromOverview();
|
||||||
|
} else {
|
||||||
|
view.zoomFromOverview();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
hide: function() {
|
hide: function() {
|
||||||
|
Loading…
Reference in New Issue
Block a user