Skip to content

Commit 69f9b05

Browse files
committed
feat: Prevent background being removed on welcome screens, b=(no-bug), c=common, tabs, welcome
1 parent 280f0ca commit 69f9b05

File tree

5 files changed

+22
-10
lines changed

5 files changed

+22
-10
lines changed

src/zen/common/ZenStartup.mjs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
// file, You can obtain one at http://mozilla.org/MPL/2.0/.
44
{
55
var ZenStartup = {
6+
_watermarkIgnoreElements: ['zen-browser-background'],
7+
68
init() {
79
this.openWatermark();
810
this._initBrowserBackground();
@@ -107,9 +109,10 @@
107109
closeWatermark() {
108110
document.documentElement.removeAttribute('zen-before-loaded');
109111
if (Services.prefs.getBoolPref('zen.watermark.enabled', false)) {
112+
let elementsToIgnore = this._watermarkIgnoreElements.map((id) => '#' + id).join(', ');
110113
gZenUIManager.motion
111114
.animate(
112-
'#browser > *, #urlbar, #tabbrowser-tabbox > *',
115+
'#browser > *:not(' + elementsToIgnore + '), #urlbar, #tabbrowser-tabbox > *',
113116
{
114117
opacity: [0, 1],
115118
},

src/zen/common/styles/zen-browser-ui.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
}
2727
}
2828

29-
:root[zen-before-loaded='true'] #browser > *,
29+
:root[zen-before-loaded='true'] #browser > *:not(#zen-browser-background),
3030
:root[zen-before-loaded='true'] #urlbar {
3131
opacity: 0 !important;
3232
}

src/zen/tabs/zen-tabs/vertical-tabs.css

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1314,15 +1314,15 @@
13141314

13151315
/* Style background */
13161316
& .tab-background {
1317-
border-radius: var(--border-radius-medium) !important; /* Use medium radius */
1318-
transition: background 0.1s ease-in-out; /* Smooth background transition */
1317+
border-radius: var(--border-radius-medium) !important;
1318+
transition: background 0.1s ease-in-out;
13191319
}
13201320

13211321
--tab-selected-bgcolor: light-dark(rgba(255, 255, 255, 0.85), rgba(255, 255, 255, 0.2));
13221322

13231323
&:not([visuallyselected], [multiselected='true']) .tab-background {
1324-
background: var(--zen-toolbar-element-bg); /* Use generic element background */
1325-
border: none; /* No border */
1324+
background: var(--zen-toolbar-element-bg);
1325+
border: none;
13261326
}
13271327

13281328
& .tab-content {

src/zen/welcome/ZenWelcome.mjs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,13 @@
66
var _tabsToPin = [];
77
var _tabsToPinEssentials = [];
88

9+
const kZenElementsToIgnore = ['zen-browser-background'];
10+
911
function clearBrowserElements() {
1012
for (const element of document.getElementById('browser').children) {
13+
if (kZenElementsToIgnore.includes(element.id)) {
14+
continue;
15+
}
1116
element.style.display = 'none';
1217
}
1318
}
@@ -266,11 +271,15 @@
266271
document.getElementById('zen-welcome').remove();
267272
document.documentElement.removeAttribute('zen-welcome-stage');
268273
for (const element of document.getElementById('browser').children) {
274+
if (kZenElementsToIgnore.includes(element.id)) {
275+
continue;
276+
}
269277
element.style.opacity = 0;
270278
element.style.removeProperty('display');
271279
}
272280
gZenUIManager.updateTabsToolbar();
273-
await animate('#browser > *', { opacity: [0, 1] });
281+
let elementsToIgnore = kZenElementsToIgnore.map((id) => `#${id}`).join(', ');
282+
await animate(`#browser > *:not(${elementsToIgnore})`, { opacity: [0, 1] });
274283
gZenUIManager.showToast('zen-welcome-finished');
275284
}
276285

src/zen/welcome/zen-welcome.css

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -207,8 +207,8 @@
207207
}
208208

209209
#zen-welcome-initial-essentials-browser {
210-
width: 70%;
211-
height: 80%;
210+
min-width: 70%;
211+
min-height: 80%;
212212
display: flex;
213213
margin-left: auto;
214214
margin-top: auto;
@@ -282,7 +282,7 @@
282282
--border-radius-medium: 1rem;
283283

284284
&[visuallyselected] {
285-
transform: scale(1.04);
285+
transform: scale(1.06);
286286
}
287287

288288
& .tab-background::after {

0 commit comments

Comments
 (0)