Skip to content

Commit c7333ca

Browse files
committed
feat: Make sure XUL store persists compact mode after change, b=(no-bug), c=compact-mode
1 parent e0bf7d0 commit c7333ca

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

src/zen/compact-mode/ZenCompactMode.mjs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,10 @@ var gZenCompactModeManager = {
9191
this.preference === value ||
9292
document.documentElement.hasAttribute('zen-compact-animating')
9393
) {
94+
if (typeof this._wasInCompactMode !== 'undefined') {
95+
// We wont do anything with it anyway, so we remove it
96+
delete this._wasInCompactMode;
97+
}
9498
// We dont want the user to be able to spam the button
9599
return value;
96100
}
@@ -99,6 +103,7 @@ var gZenCompactModeManager = {
99103
// main-window can't store attributes other than window sizes, so we use this instead
100104
lazyCompactMode.mainAppWrapper.setAttribute('zen-compact-mode', value);
101105
document.documentElement.setAttribute('zen-compact-mode', value);
106+
Services.xulStore.persist(lazyCompactMode.mainAppWrapper, 'zen-compact-mode');
102107
this._updateEvent();
103108
return value;
104109
},

src/zen/compact-mode/zen-compact-mode.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,7 @@
152152
border-radius: calc(var(--zen-native-inner-radius) + var(--zen-element-separation) / 4);
153153
@media -moz-pref('zen.view.compact.color-sidebar') {
154154
background: var(--zen-main-browser-background-toolbar) !important;
155+
background-attachment: fixed !important;
155156
background-size: 2000px !important;
156157
@media -moz-pref('zen.theme.acrylic-elements') {
157158
backdrop-filter: blur(42px) saturate(110%) brightness(0.25) contrast(100%) !important;

0 commit comments

Comments
 (0)