1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 01:19: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
- [`Release`](https://zen-browser.app/download) - Is currently built using Firefox version `139.0.4`! 🚀
- [`Twilight`](https://zen-browser.app/download?twilight) - Is currently built using Firefox version `RC 140.0`!
- [`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.1`!
### 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.scroll-modifier-key','ctrl'); // can be ctrl, alt, shift, or a meta key
pref('services.sync.engine.workspaces', false);
pref('zen.workspaces.container-specific-essentials-enabled', false);
pref('zen.workspaces.separate-essentials', true);
#ifdef MOZILLA_OFFICIAL
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.glance.enabled', tabsUnloaderPrefListener); // We can use the same listener for both prefs
Services.prefs.addObserver(
'zen.workspaces.container-specific-essentials-enabled',
tabsUnloaderPrefListener
);
Services.prefs.addObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
Services.prefs.addObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
window.addEventListener('unload', () => {
Services.prefs.removeObserver('zen.tab-unloader.enabled', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.glance.enabled', tabsUnloaderPrefListener);
Services.prefs.removeObserver('zen.glance.activation-method', tabsUnloaderPrefListener);
Services.prefs.removeObserver(
'zen.workspaces.container-specific-essentials-enabled',
tabsUnloaderPrefListener
);
Services.prefs.removeObserver('zen.workspaces.separate-essentials', tabsUnloaderPrefListener);
});
},
};
@ -1153,7 +1147,7 @@ Preferences.addAll([
default: true,
},
{
id: 'zen.workspaces.container-specific-essentials-enabled',
id: 'zen.workspaces.separate-essentials',
type: 'bool',
default: false,
},

View file

@ -47,7 +47,7 @@
preference="zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url"/>
<checkbox id="zenPinnedTabContainerSpecificEssentials"
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">
<label id="zenPinnedTabCloseShortcutBehaviorLabel" data-l10n-id="zen-pinned-tab-manager-close-shortcut-behavior-label"/>

View file

@ -16,3 +16,8 @@
type: bool
value: true
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()) {
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,7 +93,9 @@
z-index: 1;
opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay;
transition: opacity 0.3s ease-in-out;
:root:not([swipe-gesture='true']) & {
transition: opacity 0.3s ease-in-out;
}
}
}

View file

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

View file

@ -1,5 +1,5 @@
[DEFAULT]
prefs = ["zen.workspaces.container-specific-essentials-enabled=true"]
prefs = ["zen.workspaces.separate-essentials=true"]
["browser_container_auto_switch.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_noreset.js"]

View file

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

View file

@ -1253,7 +1253,11 @@
};
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) {
@ -1629,8 +1633,8 @@
const gradient = this.getGradient(workspace.theme.gradientColors);
this.currentOpacity = previousOpacity;
this.#currentLightness = previousLightness;
this.#gradientsCache[uuid] = gradient;
return gradient;
this.#gradientsCache[uuid] = [gradient, workspace.theme.texture ?? 0];
return this.#gradientsCache[uuid];
}
}

View file

@ -100,7 +100,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
false
);
this.containerSpecificEssentials = Services.prefs.getBoolPref(
'zen.workspaces.container-specific-essentials-enabled',
'zen.workspaces.separate-essentials',
false
);
ChromeUtils.defineLazyGetter(this, 'tabContainer', () =>
@ -695,6 +695,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
element.addEventListener(
'MozSwipeGestureEnd',
() => {
Services.prefs.setBoolPref('zen.swipe.is-fast-swipe', false);
document.documentElement.removeAttribute('swipe-gesture');
gZenUIManager.tabsWrapper.style.removeProperty('scrollbar-width');
delete this._hasAnimatedBackgrounds;
@ -742,6 +743,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
lastDelta: 0,
direction: null,
};
Services.prefs.setBoolPref('zen.swipe.is-fast-swipe', true);
}
_handleSwipeUpdate(event) {
@ -762,7 +764,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
translateX = this._swipeState.lastDelta;
}
if (Math.abs(delta) > 1) {
if (Math.abs(delta) > 0.8) {
this._swipeState.direction = delta > 0 ? 'left' : 'right';
}
@ -1713,30 +1715,33 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
if (offsetPixels) {
// Find the next workspace we are scrolling to
if (!this._hasAnimatedBackgrounds) {
this._hasAnimatedBackgrounds = true;
const nextWorkspace = workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)];
if (nextWorkspace) {
const nextGradient = await gZenThemePicker.getGradientForWorkspace(nextWorkspace);
const existingBackground = document.documentElement.style.getPropertyValue(
'--zen-main-browser-background'
const nextWorkspace = workspaces.workspaces[workspaceIndex + (offsetPixels > 0 ? -1 : 1)];
if (nextWorkspace) {
const [nextGradient, nextGrain] =
await gZenThemePicker.getGradientForWorkspace(nextWorkspace);
const [existingBackground, existingGrain] =
await gZenThemePicker.getGradientForWorkspace(workspace);
const percentage = Math.abs(offsetPixels) / 200;
if (!this._hasAnimatedBackgrounds) {
this._hasAnimatedBackgrounds = true;
document.documentElement.style.setProperty(
'--zen-main-browser-background-old',
existingBackground
);
if (existingBackground !== nextGradient) {
document.documentElement.style.setProperty(
'--zen-main-browser-background-old',
existingBackground
);
document.documentElement.style.setProperty(
'--zen-main-browser-background',
nextGradient
);
}
document.documentElement.style.setProperty('--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 {
delete this._hasAnimatedBackgrounds;
}

View file

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