fix: Fixed compact mode not being always enabled at startup, b=bug #8606, c=compact-mode

This commit is contained in:
mr. m
2025-07-10 16:42:10 +02:00
parent 28a0f69a52
commit acde67213d
2 changed files with 10 additions and 5 deletions

View File

@@ -12,3 +12,6 @@ pref('zen.view.compact.color-sidebar', true);
pref('zen.view.compact.animate-sidebar', true);
pref('zen.view.compact.show-sidebar-and-toolbar-on-hover', true);
pref('zen.view.compact.show-background-tab-toast', true);
# Do not edit manually
pref('zen.view.compact.should-enable-at-startup', false);

View File

@@ -36,11 +36,12 @@ var gZenCompactModeManager = {
preInit() {
// Remove it before initializing so we can properly calculate the width
// of the sidebar at startup and avoid overflowing items not being hidden
this._wasInCompactMode = Services.xulStore.getValue(
AppConstants.BROWSER_CHROME_URL,
'zen-main-app-wrapper',
'zen-compact-mode'
);
this._wasInCompactMode =
Services.xulStore.getValue(
AppConstants.BROWSER_CHROME_URL,
'zen-main-app-wrapper',
'zen-compact-mode'
) || Services.prefs.getBoolPref('zen.view.compact.should-enable-at-startup', false);
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
this.addContextMenu();
@@ -106,6 +107,7 @@ var gZenCompactModeManager = {
lazyCompactMode.mainAppWrapper.setAttribute('zen-compact-mode', value);
document.documentElement.setAttribute('zen-compact-mode', value);
Services.xulStore.persist(lazyCompactMode.mainAppWrapper, 'zen-compact-mode');
Services.prefs.setBoolPref('zen.view.compact.should-enable-at-startup', value);
this._updateEvent();
return value;
},