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

Merge branch 'dev' into configurable-essentials-max

This commit is contained in:
Mirai 2025-06-26 18:06:22 -03:00 committed by GitHub
commit d1df727d8b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
16 changed files with 87 additions and 53 deletions

View file

@ -29,8 +29,8 @@ Zen is a firefox-based browser with the aim of pushing your productivity to a ne
### Firefox Versions ### Firefox Versions
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `139.0.4`! 🚀 - [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `140.0.1`! 🚀
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 140.0`! - [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 140.0.1`!
### Contributing ### Contributing

View file

@ -1 +1 @@
667950575bde54b8d83db2a25ccf468522d4e0c9 d5e5ed08dac5a263dbc7784dff272198b17bbc4f

View file

@ -11,7 +11,7 @@ pref('zen.workspaces.wrap-around-navigation', true);
pref('zen.workspaces.natural-scroll', false); pref('zen.workspaces.natural-scroll', false);
pref('zen.workspaces.scroll-modifier-key','ctrl'); // can be ctrl, alt, shift, or a meta key pref('zen.workspaces.scroll-modifier-key','ctrl'); // can be ctrl, alt, shift, or a meta key
pref('services.sync.engine.workspaces', false); pref('services.sync.engine.workspaces', false);
pref('zen.workspaces.container-specific-essentials-enabled', false); pref('zen.workspaces.separate-essentials', true);
#ifdef MOZILLA_OFFICIAL #ifdef MOZILLA_OFFICIAL
pref('zen.workspaces.debug', false); pref('zen.workspaces.debug', false);

View file

@ -742,19 +742,13 @@ var gZenWorkspacesSettings = {
}; };
Services.prefs.addObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.addObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener);
Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs Services.prefs.addObserver('zen.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs
Services.prefs.addObserver( Services.prefs.addObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
'zen.workspaces.container-specific-essentials-enabled',
tabsUnloaderPrefListener
);
Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener); Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
window.addEventListener('unload', () => { window.addEventListener('unload', () => {
Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener); Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
Services.prefs.removeObserver( Services.prefs.removeObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
'zen.workspaces.container-specific-essentials-enabled',
tabsUnloaderPrefListener
);
}); });
}, },
}; };
@ -1153,7 +1147,7 @@ Preferences.addAll([
default: true, default: true,
}, },
{ {
id: 'zen.workspaces.container-specific-essentials-enabled', id: 'zen.workspaces.separate-essentials',
type: 'bool', type: 'bool',
default: false, default: false,
}, },

View file

@ -47,7 +47,7 @@
preference="zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url"/> preference="zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url"/>
<checkbox id="zenPinnedTabContainerSpecificEssentials" <checkbox id="zenPinnedTabContainerSpecificEssentials"
data-l10n-id="zen-pinned-tab-manager-container-specific-essentials-enabled" data-l10n-id="zen-pinned-tab-manager-container-specific-essentials-enabled"
preference="zen.workspaces.container-specific-essentials-enabled"/> preference="zen.workspaces.separate-essentials"/>
<hbox align="center"> <hbox align="center">
<label id="zenPinnedTabCloseShortcutBehaviorLabel" data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-label"/> <label id="zenPinnedTabCloseShortcutBehaviorLabel" data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-label"/>

View file

@ -16,3 +16,8 @@
type: bool type: bool
value: true value: true
mirror: always mirror: always
- name: zen.swipe.is-fast-swipe
type: bool
value: true
mirror: always

View file

@ -0,0 +1,21 @@
diff --git a/widget/SwipeTracker.cpp b/widget/SwipeTracker.cpp
index b09252fd60beb10d5865d226c39ee0c8a9c22d87..91f68161209c6ca3f3bac22997d4e2066f1fafec 100644
--- a/widget/SwipeTracker.cpp
+++ b/widget/SwipeTracker.cpp
@@ -5,6 +5,7 @@
* You can obtain one at http://mozilla.org/MPL/2.0/. */
#include "SwipeTracker.h"
+#include "mozilla/StaticPrefs_zen.h"
#include "InputData.h"
#include "mozilla/FlushType.h"
@@ -90,7 +91,7 @@ bool SwipeTracker::ComputeSwipeSuccess() const {
return (mGestureAmount * targetValue +
mCurrentVelocity * targetValue *
- StaticPrefs::widget_swipe_success_velocity_contribution()) >=
+ (StaticPrefs::zen_swipe_is_fast_swipe() ? 0.5 : StaticPrefs::widget_swipe_success_velocity_contribution())) >=
kSwipeSuccessThreshold;
}

View file

@ -51,6 +51,10 @@ class nsZenUIMigration {
if (userChromeFile.exists() || userContentFile.exists()) { if (userChromeFile.exists() || userContentFile.exists()) {
Services.prefs.setBoolPref('toolkit.legacyUserProfileCustomizations.stylesheets', true); Services.prefs.setBoolPref('toolkit.legacyUserProfileCustomizations.stylesheets', true);
} }
Services.prefs.setBoolPref(
'zen.workspaces.separate-essentials',
Services.prefs.getBoolPref('zen.workspaces.container-specific-essentials-enabled', false)
);
} }
} }

View file

@ -93,9 +93,11 @@
z-index: 1; z-index: 1;
opacity: var(--zen-grainy-background-opacity, 0); opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay; mix-blend-mode: overlay;
:root:not([swipe-gesture='true']) & {
transition: opacity 0.3s ease-in-out; transition: opacity 0.3s ease-in-out;
} }
} }
}
#sidebar-box { #sidebar-box {
/** Sidebar is already hidden in full screen mode */ /** Sidebar is already hidden in full screen mode */

View file

@ -130,8 +130,8 @@
--toolbarbutton-hover-background: color-mix( --toolbarbutton-hover-background: color-mix(
in srgb, in srgb,
var(--zen-branding-bg-reverse) 5%, var(--zen-branding-bg-reverse) 7.5%,
transparent 95% transparent 92.5%
); );
--toolbarbutton-active-background: color-mix( --toolbarbutton-active-background: color-mix(
@ -192,11 +192,7 @@
--zen-active-tab-scale: 0.98; --zen-active-tab-scale: 0.98;
/* Define tab hover background color */ /* Define tab hover background color */
--tab-hover-background-color: color-mix( --tab-hover-background-color: var(--toolbarbutton-hover-background);
in srgb,
var(--toolbarbutton-hover-background) 50%,
transparent 50%
);
/* Nativity */ /* Nativity */
--zen-native-content-radius: var(--zen-border-radius); --zen-native-content-radius: var(--zen-border-radius);

View file

@ -1,5 +1,5 @@
[DEFAULT] [DEFAULT]
prefs = ["zen.workspaces.container-specific-essentials-enabled=true"] prefs = ["zen.workspaces.separate-essentials=true"]
["browser_container_auto_switch.js"] ["browser_container_auto_switch.js"]
["browser_container_specific_essentials.js"] ["browser_container_specific_essentials.js"]

View file

@ -1,3 +1,5 @@
[DEFAULT]
prefs = ["zen.workspaces.separate-essentials=false"]
["browser_pinned_unload_changed.js"] ["browser_pinned_unload_changed.js"]
["browser_pinned_unload_noreset.js"] ["browser_pinned_unload_noreset.js"]

View file

@ -1,4 +1,5 @@
[DEFAULT] [DEFAULT]
prefs = ["zen.workspaces.separate-essentials=false"]
support-files = [ support-files = [
"head.js", "head.js",
] ]

View file

@ -1253,7 +1253,11 @@
}; };
getMostDominantColor(allColors) { getMostDominantColor(allColors) {
return this.getPrimaryColor(allColors); const color = this.getPrimaryColor(allColors);
if (typeof color === 'string') {
return this.hexToRgb(color);
}
return color;
} }
blendColors(rgb1, rgb2, percentage) { blendColors(rgb1, rgb2, percentage) {
@ -1629,8 +1633,8 @@
const gradient = this.getGradient(workspace.theme.gradientColors); const gradient = this.getGradient(workspace.theme.gradientColors);
this.currentOpacity = previousOpacity; this.currentOpacity = previousOpacity;
this.#currentLightness = previousLightness; this.#currentLightness = previousLightness;
this.#gradientsCache[uuid] = gradient; this.#gradientsCache[uuid] = [gradient, workspace.theme.texture ?? 0];
return gradient; return this.#gradientsCache[uuid];
} }
} }

View file

@ -100,7 +100,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
false false
); );
this.containerSpecificEssentials = Services.prefs.getBoolPref( this.containerSpecificEssentials = Services.prefs.getBoolPref(
'zen.workspaces.container-specific-essentials-enabled', 'zen.workspaces.separate-essentials',
false false
); );
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => ChromeUtils.defineLazyGetter(this, 'tabContainer', () =>
@ -695,6 +695,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
element.addEventListener( element.addEventListener(
'MozSwipeGestureEnd', 'MozSwipeGestureEnd',
() => { () => {
Services.prefs.setBoolPref('zen.swipe.is-fast-swipe', false);
document.documentElement.removeAttribute('swipe-gesture'); document.documentElement.removeAttribute('swipe-gesture');
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width'); gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
delete this._hasAnimatedBackgrounds; delete this._hasAnimatedBackgrounds;
@ -742,6 +743,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
lastDelta: 0, lastDelta: 0,
direction: null, direction: null,
}; };
Services.prefs.setBoolPref('zen.swipe.is-fast-swipe', true);
} }
_handleSwipeUpdate(event) { _handleSwipeUpdate(event) {
@ -762,7 +764,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
translateX = this._swipeState.lastDelta; translateX = this._swipeState.lastDelta;
} }
if (Math.abs(delta) > 1) { if (Math.abs(delta) > 0.8) {
this._swipeState.direction = delta > 0 ? 'left' : 'right'; this._swipeState.direction = delta > 0 ? 'left' : 'right';
} }
@ -1713,30 +1715,33 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
} }
if (offsetPixels) { if (offsetPixels) {
// Find the next workspace we are scrolling to // Find the next workspace we are scrolling to
if (!this._hasAnimatedBackgrounds) {
this._hasAnimatedBackgrounds = true;
const nextWorkspace = workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)]; const nextWorkspace = workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)];
if (nextWorkspace) { if (nextWorkspace) {
const nextGradient = await gZenThemePicker.getGradientForWorkspace(nextWorkspace); const [nextGradient, nextGrain] =
const existingBackground = document.documentElement.style.getPropertyValue( await gZenThemePicker.getGradientForWorkspace(nextWorkspace);
'--zen-main-browser-background' const [existingBackground, existingGrain] =
); await gZenThemePicker.getGradientForWorkspace(workspace);
if (existingBackground !== nextGradient) { const percentage = Math.abs(offsetPixels) / 200;
if (!this._hasAnimatedBackgrounds) {
this._hasAnimatedBackgrounds = true;
document.documentElement.style.setProperty( document.documentElement.style.setProperty(
'--zen-main-browser-background-old', '--zen-main-browser-background-old',
existingBackground existingBackground
); );
document.documentElement.style.setProperty( document.documentElement.style.setProperty('--zen-main-browser-background', nextGradient);
'--zen-main-browser-background',
nextGradient
);
} }
document.documentElement.style.setProperty('--zen-background-opacity', percentage);
// Fit the offsetPixels into the grain limits. Both ends may be nextGrain and existingGrain,
// so we need to use the min and max of both. For example, existing may be 0.2 and next may be 0.5,
// meaning we should convert the offset to a percentage between 0.2 and 0.5. BUT if existingGrain
// is 0.5 and nextGrain is 0.2, we should still convert the offset to a percentage between 0.2 and 0.5.
const minGrain = Math.min(existingGrain, nextGrain);
const maxGrain = Math.max(existingGrain, nextGrain);
const grainValue =
minGrain +
(maxGrain - minGrain) * (existingGrain > nextGrain ? 1 - percentage : percentage);
gZenThemePicker.updateNoise(grainValue);
} }
}
document.documentElement.style.setProperty(
'--zen-background-opacity',
Math.abs(offsetPixels) / 200
);
} else { } else {
delete this._hasAnimatedBackgrounds; delete this._hasAnimatedBackgrounds;
} }

View file

@ -5,8 +5,8 @@
"binaryName": "zen", "binaryName": "zen",
"version": { "version": {
"product": "firefox", "product": "firefox",
"version": "139.0.4", "version": "140.0.1",
"candidate": "140.0" "candidate": "140.0.1"
}, },
"buildOptions": { "buildOptions": {
"generateBranding": true "generateBranding": true
@ -19,7 +19,7 @@
"brandShortName": "Zen", "brandShortName": "Zen",
"brandFullName": "Zen Browser", "brandFullName": "Zen Browser",
"release": { "release": {
"displayVersion": "1.13.2b", "displayVersion": "1.14b",
"github": { "github": {
"repo": "zen-browser/desktop" "repo": "zen-browser/desktop"
}, },
@ -39,7 +39,7 @@
"brandShortName": "Twilight", "brandShortName": "Twilight",
"brandFullName": "Zen Twilight", "brandFullName": "Zen Twilight",
"release": { "release": {
"displayVersion": "1.14t", "displayVersion": "1.15t",
"github": { "github": {
"repo": "zen-browser/desktop" "repo": "zen-browser/desktop"
} }