mirror of
https://github.com/zen-browser/desktop.git
synced 2026-01-18 10:57:14 +00:00
Defer compact mode initialization until after delayed startup finishes and update CSS for hover state handling
This commit is contained in:
@@ -40,8 +40,29 @@
|
||||
} catch (e) {
|
||||
console.error('ZenThemeModifier: Error initializing browser layout', e);
|
||||
}
|
||||
ZenWorkspaces.promiseInitialized.then(() => {
|
||||
gZenCompactModeManager.init();
|
||||
if (gBrowserInit.delayedStartupFinished) {
|
||||
this.delayedStartupFinished();
|
||||
} else {
|
||||
Services.obs.addObserver(this, 'browser-delayed-startup-finished');
|
||||
}
|
||||
},
|
||||
|
||||
observe(aSubject, aTopic) {
|
||||
// This nsIObserver method allows us to defer initialization until after
|
||||
// this window has finished painting and starting up.
|
||||
if (aTopic == 'browser-delayed-startup-finished' && aSubject == window) {
|
||||
Services.obs.removeObserver(this, 'browser-delayed-startup-finished');
|
||||
this.delayedStartupFinished();
|
||||
}
|
||||
},
|
||||
|
||||
delayedStartupFinished() {
|
||||
ZenWorkspaces.promiseInitialized.then(async () => {
|
||||
await delayedStartupPromise;
|
||||
await SessionStore.promiseAllWindowsRestored;
|
||||
setTimeout(() => {
|
||||
gZenCompactModeManager.init();
|
||||
}, 0);
|
||||
this.closeWatermark();
|
||||
});
|
||||
},
|
||||
|
||||
@@ -351,6 +351,7 @@
|
||||
}
|
||||
|
||||
& #zen-appcontent-navbar-container[zen-has-hover],
|
||||
& #zen-appcontent-navbar-container:hover,
|
||||
& #zen-appcontent-navbar-container:focus-within,
|
||||
& #zen-appcontent-navbar-container[zen-user-show],
|
||||
& #zen-appcontent-navbar-container[has-popup-menu],
|
||||
|
||||
@@ -56,9 +56,6 @@ var gZenCompactModeManager = {
|
||||
});
|
||||
}
|
||||
this.preference = this._wasInCompactMode;
|
||||
if (this._wasInCompactMode) {
|
||||
document.documentElement.setAttribute('zen-compact-mode', true);
|
||||
}
|
||||
},
|
||||
|
||||
get preference() {
|
||||
@@ -66,7 +63,6 @@ var gZenCompactModeManager = {
|
||||
},
|
||||
|
||||
set preference(value) {
|
||||
console.log((new Error()).stack);
|
||||
if (this.preference === value || document.documentElement.hasAttribute('zen-compact-animating')) {
|
||||
// We dont want the user to be able to spam the button
|
||||
return value;
|
||||
|
||||
@@ -983,11 +983,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
|
||||
// If there's ANY pinned tab on the list, we clone the pinned tab
|
||||
// state to all the tabs
|
||||
const allArePinned = tabs.every((tab) => tab.pinned);
|
||||
const allAreEssential = tabs.every((tab) => tab.hasAttribute('zen-essential'));
|
||||
const thereIsOnePinned = tabs.some((tab) => tab.pinned);
|
||||
const thereIsOneEssential = tabs.some((tab) => tab.hasAttribute('zen-essential'));
|
||||
|
||||
if ((thereIsOneEssential && !allAreEssential) || (thereIsOnePinned && !allArePinned)) {
|
||||
if (thereIsOneEssential || (thereIsOnePinned && !allArePinned)) {
|
||||
for (let i = 0; i < tabs.length; i++) {
|
||||
const tab = tabs[i];
|
||||
if (tab.pinned) {
|
||||
|
||||
Reference in New Issue
Block a user