1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 01:19:59 +02:00

feat: Small fixes to gradient picker, b=no-bug, c=media, workspaces

This commit is contained in:
mr. m 2025-06-30 19:58:54 +02:00
parent a06b7b6b38
commit 87088d016c
No known key found for this signature in database
GPG key ID: 928E01ED4C97749F
2 changed files with 7 additions and 4 deletions

View file

@ -290,7 +290,7 @@
#zen-media-playback-buttons { #zen-media-playback-buttons {
justify-content: space-between; justify-content: space-between;
max-width: 7em; max-width: 10em;
width: 100%; width: 100%;
} }

View file

@ -1110,7 +1110,7 @@
`linear-gradient(${rotation + 180}deg, ${this.getSingleRGBColor(themedColors[0], forToolbar)} 0%, transparent 100%)`, `linear-gradient(${rotation + 180}deg, ${this.getSingleRGBColor(themedColors[0], forToolbar)} 0%, transparent 100%)`,
].join(', '); ].join(', ');
} }
return `linear-gradient(${rotation}deg, ${this.getSingleRGBColor(themedColors[0], forToolbar)} 0%, ${this.getSingleRGBColor(themedColors[1], forToolbar)} 100%)`; return `linear-gradient(${rotation}deg, ${this.getSingleRGBColor(themedColors[1], forToolbar)} 0%, ${this.getSingleRGBColor(themedColors[0], forToolbar)} 100%)`;
} else if (themedColors.length === 3) { } else if (themedColors.length === 3) {
let color1 = this.getSingleRGBColor(themedColors[2], forToolbar); let color1 = this.getSingleRGBColor(themedColors[2], forToolbar);
let color2 = this.getSingleRGBColor(themedColors[0], forToolbar); let color2 = this.getSingleRGBColor(themedColors[0], forToolbar);
@ -1450,7 +1450,10 @@
); );
let isDarkMode = this.isDarkMode; let isDarkMode = this.isDarkMode;
if (!isDefaultTheme) { if (!isDefaultTheme) {
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor); // Check for the primary color
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(
workspaceTheme.gradientColors[0].c
);
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode); browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
} else { } else {
browser.document.documentElement.removeAttribute('zen-should-be-dark-mode'); browser.document.documentElement.removeAttribute('zen-should-be-dark-mode');
@ -1475,7 +1478,7 @@
!theme.gradientColors.find((color) => color.isPrimary) && !theme.gradientColors.find((color) => color.isPrimary) &&
theme.gradientColors.length > 0 theme.gradientColors.length > 0
) { ) {
theme.gradientColors[(theme.gradientColors.length / 2) | 0].isPrimary = true; theme.gradientColors[0].isPrimary = true;
} }
return theme; return theme;
} }