Compare commits

..

14 Commits

Author SHA1 Message Date
mr. m
ff0a25b704 feat: Tweak colors to blend for windows/mica, b=no-bug, c=workspaces 2025-07-13 23:28:42 +02:00
mr. m
f456994b61 feat: Improved color blending for transparent systems, b=no-bug, c=common, workspaces 2025-07-13 18:20:14 +02:00
mr. m
9988994129 fix: Dont set compact mode preference when initializing, b=no-bug, c=compact-mode 2025-07-13 13:47:04 +02:00
mr. m
98cf09f4e2 feat: Always use the system theme when using custom colors, b=no-bug, c=workspaces 2025-07-13 12:35:44 +02:00
mr. m
6941ec099c fix: Fixed wrongly set patch, b=no-bug, c=no-component 2025-07-13 11:56:00 +02:00
mr. m
0c99d9b5ef feat: Make the sidebar darker when no color is selected, b=no-bug, c=workspaces 2025-07-12 20:54:00 +02:00
Fergus Yip
0fe812f218 add open button to background tab toast (#9428)
* add open button to background tab toast

* address comment
2025-07-12 17:41:23 +02:00
Jai A P
60acb71aa6 Fix incorrect tab count in closing confirmation dialog (#9408) 2025-07-12 14:03:14 +02:00
mr. m
b28bc42504 feat: Improved color saturation calculations, b=no-bug, c=common, workspaces 2025-07-12 11:20:17 +02:00
mr. m
bf859a826e chore: Bump version, b=no-bug, c=no-component 2025-07-12 09:10:41 +02:00
mr. m
70cc16ea8e fix: Fixed wrong color schemes in different elements, b=bug #9229, c=common 2025-07-12 09:03:32 +02:00
mr. m
9080fae09d Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2025-07-12 08:52:03 +02:00
mr. m
c4e7f4e442 feat: Added option to always use system theme and improve color handling for mica, b=no-bug, c=common, workspaces 2025-07-12 08:51:55 +02:00
Mr. M
c5ce3af9fe fix: Fixed windows signing process not being configured correctly, b=no-bug, c=no-component 2025-07-11 14:36:01 +02:00
16 changed files with 127 additions and 39 deletions

View File

@@ -0,0 +1,12 @@
Remove-Item -Recurse -Force engine
Remove-Item -Recurse -Force .surfer
npm run init
$job = Start-Job -ScriptBlock {
npm run build
}
# Wait for job to complete with timeout (in seconds)
$job | Wait-Job -Timeout 5

View File

@@ -6,7 +6,7 @@ param(
$ErrorActionPreference = "Stop"
echo "Preparing environment"
git pull --recurse
git pull origin dev --recurse
mkdir windsign-temp -ErrorAction SilentlyContinue
# Download in parallel
@@ -113,6 +113,7 @@ signtool.exe sign /n "$SignIdentity" /t http://time.certum.pl/ /fd sha256 /v $fi
$env:ZEN_RELEASE="true"
$env:SURFER_SIGNING_MODE="true"
$env:SCCACHE_GHA_ENABLED="false"
Wait-Job -Name "SurferInit"
Wait-Job -Name "DownloadGitl10n"

View File

@@ -22,3 +22,4 @@ pref('zen.theme.essentials-favicon-bg', true);
# Light weight themes
pref('zen.theme.disable-lightweight', true);
pref('zen.theme.use-sysyem-colors', false);

View File

@@ -102,9 +102,9 @@
</box>
<html:input type="range" max="0.9" value="0.4" step="0.001" id="PanelUI-zen-gradient-generator-opacity"
#ifdef XP_MACOSX
min="0.3"
#else
min="0.25"
#else
min="0.35"
#endif
/>
</vbox>

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/BrowserGlue.sys.mjs b/browser/components/BrowserGlue.sys.mjs
index bde641f7112adde948707c172b9f18d3635d8ef1..3f430451586904e6be086114ec10f719745093be 100644
index bde641f7112adde948707c172b9f18d3635d8ef1..70c4769d265210084c8ee2910fa68a0a38d6fb34 100644
--- a/browser/components/BrowserGlue.sys.mjs
+++ b/browser/components/BrowserGlue.sys.mjs
@@ -8,6 +8,7 @@ import { XPCOMUtils } from "resource://gre/modules/XPCOMUtils.sys.mjs";
@@ -10,6 +10,15 @@ index bde641f7112adde948707c172b9f18d3635d8ef1..3f430451586904e6be086114ec10f719
AboutHomeStartupCache: "resource:///modules/AboutHomeStartupCache.sys.mjs",
AWToolbarButton: "resource:///modules/aboutwelcome/AWToolbarUtils.sys.mjs",
ASRouter: "resource:///modules/asrouter/ASRouter.sys.mjs",
@@ -1496,7 +1497,7 @@ BrowserGlue.prototype = {
windowcount++;
let tabbrowser = win.gBrowser;
if (tabbrowser) {
- pagecount += tabbrowser.visibleTabs.length - tabbrowser.pinnedTabCount;
+ pagecount += tabbrowser.visibleTabs.filter(t => t.getAttribute("pending")!=="true").length;
}
}
@@ -1659,6 +1660,8 @@ BrowserGlue.prototype = {
} else if (profileDataVersion < APP_DATA_VERSION) {
lazy.ProfileDataUpgrader.upgrade(profileDataVersion, APP_DATA_VERSION);

View File

@@ -592,7 +592,6 @@ groupbox h2 {
#dataCollectionGroup,
#websiteAdvertisingCategory,
#websiteAdvertisingGroup,
#webAppearanceGroup,
#helpButton {
display: none !important;
}

View File

@@ -163,7 +163,8 @@
list-style-image: url('search-page.svg') !important;
}
#open-file-button {
#open-file-button,
#zen-open-background-tab-button {
list-style-image: url('open.svg') !important;
}

View File

@@ -0,0 +1,18 @@
diff --git a/toolkit/mozapps/extensions/content/aboutaddons.css b/toolkit/mozapps/extensions/content/aboutaddons.css
index d8f84dcbf83d4768b9b8174ccf07706702d690a5..afce2630bf64a262b0f6a9e752db5c745167bf6a 100644
--- a/toolkit/mozapps/extensions/content/aboutaddons.css
+++ b/toolkit/mozapps/extensions/content/aboutaddons.css
@@ -105,6 +105,13 @@ h2 {
.category[name="theme"] {
background-image: url("chrome://mozapps/skin/extensions/category-themes.svg");
}
+
+@media -moz-pref('zen.theme.disable-lightweight') {
+ .category[name="theme"] {
+ display: none;
+ }
+}
+
.category[name="plugin"] {
background-image: url("chrome://mozapps/skin/extensions/category-plugins.svg");
}

View File

@@ -19,6 +19,12 @@
& browser[transparent='true'] {
background: light-dark(rgba(255, 255, 255, 0.3), rgba(255, 255, 255, 0.1));
}
@media not -moz-pref('layout.css.prefers-color-scheme.content-override', 2) {
& browser[type='content'] {
color-scheme: env(-moz-content-preferred-color-scheme);
}
}
}
}
}

View File

@@ -40,8 +40,13 @@
menupopup,
panel {
--panel-background: var(--arrowpanel-background);
--panel-border-radius: var(--zen-native-inner-radius);
--menuitem-padding: 6px !important;
--panel-shadow-margin: 10px;
/* This should match GetMenuMaskImage() on macOS, or be overridden below */
@media (-moz-platform: macos) {
--panel-border-radius: 10px;
}
}
/* split-view popup */

View File

@@ -118,7 +118,7 @@
--zen-toolbar-element-bg: light-dark(
color-mix(in oklch, var(--toolbox-textcolor) 8%, transparent),
color-mix(in oklch, var(--toolbox-textcolor) 15%, transparent)
color-mix(in oklch, var(--toolbox-textcolor) 12.5%, transparent)
);
--zen-toolbar-element-bg-hover: light-dark(
@@ -228,9 +228,6 @@
@media (-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and -moz-pref('zen.widget.linux.transparency')) {
background: transparent;
--zen-themed-toolbar-bg-transparent: transparent;
@media -moz-pref('widget.windows.mica.toplevel-backdrop', 2) {
--zen-themed-toolbar-bg-transparent: light-dark(rgba(255, 255, 255, 0.1), rgba(0, 0, 0, 0.3));
}
}
&[zen-should-be-dark-mode='true'] #browser {
@@ -250,22 +247,27 @@
&:not([zen-should-be-dark-mode]) #zen-toast-container {
@media -moz-pref('zen.view.window.scheme', 0) {
color-scheme: dark;
--toolbar-color-scheme: dark;
}
@media -moz-pref('zen.view.window.scheme', 1) {
color-scheme: light;
--toolbar-color-scheme: light;
}
@media -moz-pref('zen.view.window.scheme', 2) {
color-scheme: light;
--toolbar-color-scheme: light;
@media (-moz-system-dark-theme) {
color-scheme: dark;
--toolbar-color-scheme: dark;
}
}
:root[privatebrowsingmode='temporary'] &,
&[privatebrowsingmode='temporary'] {
color-scheme: dark;
--toolbar-color-scheme: dark;
}
}
}

View File

@@ -107,7 +107,9 @@ 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);
if (typeof this._wasInCompactMode === 'undefined') {
Services.prefs.setBoolPref('zen.view.compact.should-enable-at-startup', value);
}
this._updateEvent();
return value;
},
@@ -689,7 +691,15 @@ var gZenCompactModeManager = {
!this._nextTimeWillBeActive &&
this.canHideSidebar
) {
gZenUIManager.showToast('zen-background-tab-opened-toast');
gZenUIManager.showToast('zen-background-tab-opened-toast', {
button: {
id: 'zen-open-background-tab-button',
command: () => {
const targetWindow = window.ownerGlobal.parent || window;
targetWindow.gBrowser.selectedTab = tab;
},
},
});
}
delete this._nextTimeWillBeActive;
},

View File

@@ -41,7 +41,7 @@
}
const MAX_OPACITY = 0.9;
const MIN_OPACITY = AppConstants.platform === 'macosx' ? 0.3 : 0.25;
const MIN_OPACITY = AppConstants.platform === 'macosx' ? 0.25 : 0.35;
const EXPLICIT_LIGHTNESS_TYPE = 'explicit-lightness';
@@ -462,8 +462,9 @@
}
const normalizedDistance = 1 - Math.min(distance / radius, 1); // Normalize distance to [0, 1]
const hue = (angle / 360) * 360; // Normalize angle to [0, 360)
const saturation = normalizedDistance * 100; // Scale distance to [0, 100]
let saturation = normalizedDistance * 100; // stays high even in center
if (type !== EXPLICIT_LIGHTNESS_TYPE) {
saturation = 80 + (1 - normalizedDistance) * 20;
// Set the current lightness to how far we are from the center of the circle
// For example, moving the dot outside will have higher lightness, while moving it inside will have lower lightness
this.#currentLightness = Math.round((1 - normalizedDistance) * 100);
@@ -1009,6 +1010,7 @@
}
themedColors(colors) {
// For non-Mica themes, we return the colors as they are
return [...colors];
}
@@ -1032,25 +1034,36 @@
return `rgba(${baseColor[0]}, ${baseColor[1]}, ${baseColor[2]}, ${baseColor[3]})`;
}
get isMica() {
return window.matchMedia('(-moz-windows-mica)').matches;
}
get canBeTransparent() {
return window.matchMedia(
'(-moz-windows-mica) or (-moz-platform: macos) or ((-moz-platform: linux) and -moz-pref("zen.widget.linux.transparency"))'
).matches;
return (
this.isMica ||
window.matchMedia(
'(-moz-platform: macos) or ((-moz-platform: linux) and -moz-pref("zen.widget.linux.transparency"))'
).matches
);
}
blendWithWhiteOverlay(baseColor, opacity) {
if (AppConstants.platform === 'macosx') {
const blendColor = [255, 255, 255];
const blendAlpha = 0.2;
const baseAlpha = baseColor[3] !== undefined ? baseColor[3] : 1;
const blended = [];
for (let i = 0; i < 3; i++) {
blended[i] = Math.round(blendColor[i] * (1 - opacity) + baseColor[i] * opacity);
}
const blendedAlpha = +(blendAlpha * (1 - opacity) + baseAlpha * opacity).toFixed(3);
return `rgba(${blended[0]}, ${blended[1]}, ${blended[2]}, ${blendedAlpha})`;
let colorToBlend;
let colorToBlendOpacity;
if (this.isMica) {
colorToBlend = !this.isDarkMode ? [0, 0, 0] : [255, 255, 255];
colorToBlendOpacity = 0.35;
} else if (AppConstants.platform === 'macosx') {
colorToBlend = [255, 255, 255];
colorToBlendOpacity = 0.3;
}
if (colorToBlend) {
const blendedAlpha = Math.min(
1,
opacity + MIN_OPACITY + colorToBlendOpacity * (1 - (opacity + MIN_OPACITY))
);
baseColor = this.blendColors(baseColor, colorToBlend, blendedAlpha * 100);
opacity += colorToBlendOpacity * (1 - opacity);
}
return `rgba(${baseColor[0]}, ${baseColor[1]}, ${baseColor[2]}, ${opacity})`;
}
@@ -1111,7 +1124,11 @@
const rotation = -45; // TODO: Detect rotation based on the accent color
if (themedColors.length === 0) {
return forToolbar ? this.getToolbarModifiedBase() : 'transparent';
return forToolbar
? this.getToolbarModifiedBase()
: this.isDarkMode
? 'rgba(0, 0, 0, 0.4)'
: 'transparent';
} else if (themedColors.length === 1) {
return this.getSingleRGBColor(themedColors[0], forToolbar);
} else {
@@ -1158,6 +1175,10 @@
}
shouldBeDarkMode(accentColor) {
if (Services.prefs.getBoolPref('zen.theme.use-sysyem-colors')) {
return this.isDarkMode;
}
if (!this.canBeTransparent) {
const toolbarBg = this.getToolbarModifiedBaseRaw();
accentColor = this.blendColors(
@@ -1174,7 +1195,7 @@
let lightText = this.getToolbarColor(false); // e.g. [r, g, b, a]
if (this.canBeTransparent) {
lightText[3] -= 0.15; // Reduce alpha for light text
lightText[3] -= 0.25; // Reduce alpha for light text
}
// Composite text color over background
@@ -1497,14 +1518,15 @@
);
browser.gZenThemePicker.isLegacyVersion = this.isLegacyVersion;
let isDarkMode = isDarkModeWindow;
if (!isDefaultTheme && !this.isLegacyVersion) {
const isUsingCustomColors = workspaceTheme.gradientColors.some((color) => color.isCustom);
if (!isDefaultTheme && !this.isLegacyVersion && !isUsingCustomColors) {
// Check for the primary color
isDarkMode = browser.gZenThemePicker.shouldBeDarkMode(dominantColor);
browser.document.documentElement.setAttribute('zen-should-be-dark-mode', isDarkMode);
browser.gZenThemePicker.panel.removeAttribute('invalidate-controls');
} else {
browser.document.documentElement.removeAttribute('zen-should-be-dark-mode');
if (!this.isLegacyVersion) {
if (!this.isLegacyVersion && !isUsingCustomColors) {
browser.gZenThemePicker.panel.setAttribute('invalidate-controls', 'true');
}
}

View File

@@ -235,7 +235,7 @@
.zen-theme-picker-gradient {
position: relative;
overflow: hidden;
border-radius: calc(var(--zen-native-content-radius) - 4px);
border-radius: calc(var(--arrowpanel-border-radius) - 4px);
min-height: calc(var(--panel-width) - var(--panel-padding) * 2 - 2px);
background: light-dark(rgba(0, 0, 0, 0.05), rgba(255, 255, 255, 0.03));
@@ -243,7 +243,7 @@
light-dark(rgba(0, 0, 0, 0.2), rgba(255, 255, 255, 0.1)) 1px,
transparent 0
);
background-position: -20px -20px;
background-position: -23px -23px;
background-size: 6px 6px;
& .zen-theme-picker-dot {

View File

@@ -22,7 +22,6 @@
display: none !important;
}
--toolbarbutton-hover-background: transparent !important;
border-radius: var(--zen-button-border-radius) !important;
background: transparent;
appearance: unset !important;
@@ -215,7 +214,10 @@
transition: opacity 0.1s;
order: 5;
--toolbarbutton-inner-padding: 6px;
--tab-border-radius: 6px;
& image {
border-radius: calc(var(--border-radius-medium) - 4px);
}
:root[zen-renaming-tab='true'] & {
display: none;

View File

@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.14.4b",
"displayVersion": "1.14.5b",
"github": {
"repo": "zen-browser/desktop"
},