1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-07 21:49:58 +02:00

feat: Fix aligment issues with initial gradient text, b=no-bug, c=common, workspaces

This commit is contained in:
Mr. M 2025-06-24 17:53:11 +02:00
parent fe77048619
commit 12ae2daeba
No known key found for this signature in database
GPG key ID: 6292C4C8F8652B18
3 changed files with 10 additions and 5 deletions

View file

@ -47,9 +47,7 @@
isolation: isolate;
:root[zen-should-be-dark-mode] {
background: var(--zen-themed-toolbar-bg-transparent);
}
&::after,
&::before {

View file

@ -1381,6 +1381,10 @@
browser.gZenThemePicker.currentOpacity = workspaceTheme.opacity ?? 0.5;
browser.gZenThemePicker.currentTexture = workspaceTheme.texture ?? 0;
const dominantColor = this.getMostDominantColor(workspaceTheme.gradientColors);
const isDefaultTheme =
dominantColor?.toString() === this.hexToRgb(this.getNativeAccentColor()).toString();
const opacitySlider = browser.document.getElementById(
'PanelUI-zen-gradient-generator-opacity'
);
@ -1400,6 +1404,9 @@
} else {
opacity = (opacity - 0.15) / (0.85 - 0.15);
}
if (isDefaultTheme) {
opacity = 1; // If it's the default theme, we want the wave to be
}
// Since it's sine waves, we can't just set the offset to the opacity, we need to calculate it
// The offset is the percentage of the wave that is visible, so we need to multiply
// the opacity by 100 to get the percentage.
@ -1484,7 +1491,6 @@
gradient
);
const dominantColor = this.getMostDominantColor(workspaceTheme.gradientColors);
if (dominantColor) {
browser.document.documentElement.style.setProperty(
'--zen-primary-color',
@ -1493,7 +1499,7 @@
: `rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]})`
);
let isDarkMode = this.isDarkMode;
if (dominantColor.toString() !== this.hexToRgb(this.getNativeAccentColor()).toString()) {
if (!isDefaultTheme) {
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
} else {

View file

@ -300,6 +300,7 @@
white-space: nowrap;
pointer-events: none;
font-size: small;
margin: 0;
&[hidden] {
display: none;