mirror of
https://github.com/zen-browser/desktop.git
synced 2025-07-10 18:15:30 +02:00
Enhance animations and sidebar panel styles for improved UI transitions
This commit is contained in:
parent
63a2ccf3da
commit
f35cc90ea4
8 changed files with 134 additions and 46 deletions
|
@ -1106,6 +1106,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
}
|
||||
|
||||
async _performWorkspaceChange(window, onInit) {
|
||||
const previousWorkspace = await this.getActiveWorkspace();
|
||||
|
||||
this.activeWorkspace = window.uuid;
|
||||
const containerId = window.containerTabId?.toString();
|
||||
const workspaces = await this._workspaces();
|
||||
|
@ -1121,6 +1123,20 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||
|
||||
// Update UI and state
|
||||
await this._updateWorkspaceState(window, onInit);
|
||||
|
||||
// Animate acordingly
|
||||
if (previousWorkspace && !this._animatingChange) {
|
||||
// we want to know if we are moving forward or backward in sense of animation
|
||||
let isNextWorkspace = onInit ||
|
||||
(workspaces.workspaces.findIndex((w) => w.uuid === previousWorkspace.uuid)
|
||||
< workspaces.workspaces.findIndex((w) => w.uuid === window.uuid));
|
||||
gBrowser.tabContainer.setAttribute('zen-workspace-animation', isNextWorkspace ? 'next' : 'previous');
|
||||
this._animatingChange = true;
|
||||
setTimeout(() => {
|
||||
this._animatingChange = false;
|
||||
gBrowser.tabContainer.removeAttribute('zen-workspace-animation');
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue