Refactor welcome page transitions and reorganize tabs after welcome screen

This commit is contained in:
mr. M
2025-02-21 11:56:31 +01:00
parent 2593d2137b
commit 6b306daf21
3 changed files with 21 additions and 1 deletions

View File

@@ -167,6 +167,9 @@
width: 1px;
height: 1px;
margin: 8rem auto auto 13.4rem;
@media (-moz-platform: macos) {
margin: 4rem auto auto 10.5rem;
}
}
#zen-welcome-initial-essentials-browser {

View File

@@ -177,7 +177,14 @@
async next() {
if (this._currentPage !== -1) {
const previousPage = this._pages[this._currentPage];
await Promise.all([this.fadeOutTitles(), this.fadeOutButtons(), this.fadeOutContent()]);
const promises = [
this.fadeOutTitles(),
this.fadeOutButtons(),
];
if (!previousPage.dontFadeOut) {
promises.push(this.fadeOutContent());
}
await Promise.all(promises);
await previousPage.fadeOut();
document.getElementById('zen-welcome-page-content').innerHTML = '';
}
@@ -193,6 +200,7 @@
}
async finish() {
ZenWorkspaces.reorganizeTabsAfterWelcome();
await animate('#zen-welcome-page-content', { x: [0, '100%'] }, { bounce: 0 });
document.getElementById('zen-welcome-page-content').remove();
await this.animHeart();
@@ -319,6 +327,7 @@
position: 'top',
});
},
dontFadeOut: true,
async fadeOut() {
gZenThemePicker.panel.removeAttribute('noautohide');
gZenThemePicker.panel.removeAttribute('consumeoutsideclicks');

View File

@@ -2229,4 +2229,12 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
(tab) => tab.hasAttribute('zen-essential') || tab.getAttribute('zen-workspace-id') === currentWorkspace
);
}
reorganizeTabsAfterWelcome() {
const children = gBrowser.tabContainer.arrowScrollbox.children;
const remainingTabs = Array.from(children).filter((child) => child.tagName === 'tab');
for (const tab of remainingTabs) {
this.moveTabToWorkspace(tab, this.activeWorkspace);
}
}
})();