Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f7fe355369 | ||
|
|
acde67213d | ||
|
|
28a0f69a52 | ||
|
|
9f9d2ee546 | ||
|
|
aabde4fb05 | ||
|
|
1f4f88ac13 |
@@ -12,3 +12,6 @@ pref('zen.view.compact.color-sidebar', true);
|
||||
pref('zen.view.compact.animate-sidebar', true);
|
||||
pref('zen.view.compact.show-sidebar-and-toolbar-on-hover', true);
|
||||
pref('zen.view.compact.show-background-tab-toast', true);
|
||||
|
||||
# Do not edit manually
|
||||
pref('zen.view.compact.should-enable-at-startup', false);
|
||||
|
||||
@@ -5,4 +5,8 @@
|
||||
# Mica
|
||||
pref("widget.windows.mica", true);
|
||||
pref("widget.windows.mica.popups", true);
|
||||
|
||||
# 1. DWMSBT_MAINWINDOW
|
||||
# 2. DWMSBT_TRANSIENTWINDOW (default, also used for popups)
|
||||
# 3(default). DWMSBT_TABBEDWINDOW
|
||||
pref("widget.windows.mica.toplevel-backdrop", 2);
|
||||
|
||||
@@ -100,7 +100,13 @@
|
||||
</defs>
|
||||
</svg>
|
||||
</box>
|
||||
<html:input type="range" min="0.3" max="0.9" value="0.4" step="0.001" id="PanelUI-zen-gradient-generator-opacity" />
|
||||
<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"
|
||||
#endif
|
||||
/>
|
||||
</vbox>
|
||||
<vbox id="PanelUI-zen-gradient-generator-texture-wrapper">
|
||||
</vbox>
|
||||
|
||||
@@ -17,6 +17,9 @@ class nsZenUIMigration {
|
||||
}
|
||||
}
|
||||
this.clearVariables();
|
||||
if (this.shouldRestart) {
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
|
||||
}
|
||||
}
|
||||
|
||||
get _migrationVersion() {
|
||||
@@ -59,8 +62,7 @@ class nsZenUIMigration {
|
||||
if (userChromeFile.exists() || userContentFile.exists()) {
|
||||
Services.prefs.setBoolPref('toolkit.legacyUserProfileCustomizations.stylesheets', true);
|
||||
console.log('ZenUIMigration: User stylesheets detected, enabling legacy stylesheets.');
|
||||
Services.startup.quit(Ci.nsIAppStartup.eAttemptQuit | Ci.nsIAppStartup.eRestart);
|
||||
return;
|
||||
this.shouldRestart = true;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -121,6 +121,11 @@
|
||||
color-mix(in oklch, var(--toolbox-textcolor) 15%, transparent)
|
||||
);
|
||||
|
||||
--zen-toolbar-element-bg-hover: light-dark(
|
||||
color-mix(in srgb, var(--zen-toolbar-element-bg) 75%, transparent),
|
||||
color-mix(in srgb, var(--zen-toolbar-element-bg) 60%, transparent)
|
||||
);
|
||||
|
||||
/* Toolbar */
|
||||
--tab-selected-color-scheme: inherit;
|
||||
|
||||
@@ -130,7 +135,7 @@
|
||||
|
||||
--toolbarbutton-inner-padding: 5px !important;
|
||||
|
||||
--toolbarbutton-hover-background: var(--zen-toolbar-element-bg) !important;
|
||||
--toolbarbutton-hover-background: var(--zen-toolbar-element-bg-hover) !important;
|
||||
|
||||
--toolbarbutton-active-background: color-mix(
|
||||
in srgb,
|
||||
@@ -172,11 +177,7 @@
|
||||
--toolbar-field-color: var(--toolbox-textcolor) !important;
|
||||
|
||||
&[zen-private-window='true'] {
|
||||
--zen-main-browser-background: linear-gradient(
|
||||
130deg,
|
||||
light-dark(rgb(247, 217, 255), rgb(10, 6, 11)) 0%,
|
||||
light-dark(rgb(242, 198, 255), rgb(19, 7, 22)) 100%
|
||||
);
|
||||
--zen-main-browser-background: linear-gradient(130deg, rgb(10, 6, 11) 0%, rgb(19, 7, 22) 100%);
|
||||
--zen-main-browser-background-toolbar: var(--zen-main-browser-background);
|
||||
--zen-primary-color: light-dark(rgb(93, 42, 107), rgb(110, 48, 125)) !important;
|
||||
--toolbox-textcolor: currentColor !important;
|
||||
|
||||
@@ -36,11 +36,12 @@ var gZenCompactModeManager = {
|
||||
preInit() {
|
||||
// Remove it before initializing so we can properly calculate the width
|
||||
// of the sidebar at startup and avoid overflowing items not being hidden
|
||||
this._wasInCompactMode = Services.xulStore.getValue(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
'zen-main-app-wrapper',
|
||||
'zen-compact-mode'
|
||||
);
|
||||
this._wasInCompactMode =
|
||||
Services.xulStore.getValue(
|
||||
AppConstants.BROWSER_CHROME_URL,
|
||||
'zen-main-app-wrapper',
|
||||
'zen-compact-mode'
|
||||
) || Services.prefs.getBoolPref('zen.view.compact.should-enable-at-startup', false);
|
||||
lazyCompactMode.mainAppWrapper.removeAttribute('zen-compact-mode');
|
||||
|
||||
this.addContextMenu();
|
||||
@@ -106,6 +107,7 @@ 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);
|
||||
this._updateEvent();
|
||||
return value;
|
||||
},
|
||||
|
||||
@@ -541,7 +541,7 @@
|
||||
case 'unload-switch':
|
||||
case 'reset-switch':
|
||||
case 'switch':
|
||||
if (behavior.includes('unload') && !selectedTab.hasAttribute('zen-essential')) {
|
||||
if (behavior.includes('unload')) {
|
||||
if (selectedTab.hasAttribute('glance-id')) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
}
|
||||
|
||||
const MAX_OPACITY = 0.9;
|
||||
const MIN_OPACITY = 0.3;
|
||||
const MIN_OPACITY = AppConstants.platform === 'macosx' ? 0.3 : 0.25;
|
||||
|
||||
const EXPLICIT_LIGHTNESS_TYPE = 'explicit-lightness';
|
||||
|
||||
@@ -425,7 +425,7 @@
|
||||
calculateInitialPosition([r, g, b]) {
|
||||
// This function is called before the picker is even rendered, so we hard code the dimensions
|
||||
// important: If any sort of sizing is changed, make sure changes are reflected here
|
||||
const padding = 20;
|
||||
const padding = 30;
|
||||
const rect = {
|
||||
width: 338,
|
||||
height: 338,
|
||||
@@ -445,7 +445,7 @@
|
||||
// Return a color as hsl based on the position in the gradient
|
||||
const gradient = this.panel.querySelector('.zen-theme-picker-gradient');
|
||||
const rect = gradient.getBoundingClientRect();
|
||||
const padding = 20; // each side
|
||||
const padding = 30; // each side
|
||||
const dotHalfSize = 36 / 2; // half the size of the dot
|
||||
x += dotHalfSize;
|
||||
y += dotHalfSize;
|
||||
@@ -691,7 +691,7 @@
|
||||
|
||||
const dotPad = this.panel.querySelector('.zen-theme-picker-gradient');
|
||||
const rect = dotPad.getBoundingClientRect();
|
||||
const padding = 20;
|
||||
const padding = 30;
|
||||
|
||||
let updatedDots = [...dots];
|
||||
const centerPosition = { x: rect.width / 2, y: rect.height / 2 };
|
||||
@@ -840,7 +840,7 @@
|
||||
|
||||
const gradient = this.panel.querySelector('.zen-theme-picker-gradient');
|
||||
const rect = gradient.getBoundingClientRect();
|
||||
const padding = 20;
|
||||
const padding = 30;
|
||||
|
||||
const centerX = rect.left + rect.width / 2;
|
||||
const centerY = rect.top + rect.height / 2;
|
||||
@@ -973,7 +973,7 @@
|
||||
if (this.dragging) {
|
||||
event.preventDefault();
|
||||
const rect = this.panel.querySelector('.zen-theme-picker-gradient').getBoundingClientRect();
|
||||
const padding = 20; // each side
|
||||
const padding = 30; // each side
|
||||
// do NOT let the ball be draged outside of an imaginary circle. You can drag it anywhere inside the circle
|
||||
// if the distance between the center of the circle and the dragged ball is bigger than the radius, then the ball
|
||||
// should be placed on the edge of the circle. If it's inside the circle, then the ball just follows the mouse
|
||||
@@ -1039,17 +1039,20 @@
|
||||
}
|
||||
|
||||
blendWithWhiteOverlay(baseColor, opacity) {
|
||||
const blendColor = [255, 255, 255];
|
||||
const blendAlpha = 0.2;
|
||||
const baseAlpha = baseColor[3] !== undefined ? baseColor[3] : 1;
|
||||
const blended = [];
|
||||
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);
|
||||
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})`;
|
||||
}
|
||||
|
||||
const blendedAlpha = +(blendAlpha * (1 - opacity) + baseAlpha * opacity).toFixed(3);
|
||||
return `rgba(${blended[0]}, ${blended[1]}, ${blended[2]}, ${blendedAlpha})`;
|
||||
return `rgba(${baseColor[0]}, ${baseColor[1]}, ${baseColor[2]}, ${opacity})`;
|
||||
}
|
||||
|
||||
getSingleRGBColor(color, forToolbar = false) {
|
||||
@@ -1067,11 +1070,21 @@
|
||||
} else {
|
||||
color = color.c;
|
||||
}
|
||||
if (this.isLegacyVersion && this.isDarkMode) {
|
||||
// In legacy version, we blend with white overlay or black overlay based on if we are in dark mode
|
||||
color = this.blendColors(color, [0, 0, 0], 30);
|
||||
}
|
||||
return this.blendWithWhiteOverlay(color, opacity);
|
||||
}
|
||||
|
||||
luminance([r, g, b]) {
|
||||
return 0.2126 * (r / 255) + 0.7152 * (g / 255) + 0.0722 * (b / 255);
|
||||
// These magic numbers are extracted from the wikipedia article on relative luminance
|
||||
// https://en.wikipedia.org/wiki/Relative_luminance
|
||||
var a = [r, g, b].map((v) => {
|
||||
v /= 255;
|
||||
return v <= 0.03928 ? v / 12.92 : Math.pow((v + 0.055) / 1.055, 2.4);
|
||||
});
|
||||
return a[0] * 0.2126 + a[1] * 0.7152 + a[2] * 0.0722;
|
||||
}
|
||||
|
||||
contrastRatio(rgb1, rgb2) {
|
||||
@@ -1160,7 +1173,9 @@
|
||||
let darkText = this.getToolbarColor(true); // e.g. [r, g, b, a]
|
||||
let lightText = this.getToolbarColor(false); // e.g. [r, g, b, a]
|
||||
|
||||
lightText[3] -= 0.4; // Reduce alpha for light text
|
||||
if (this.canBeTransparent) {
|
||||
lightText[3] -= 0.15; // Reduce alpha for light text
|
||||
}
|
||||
|
||||
// Composite text color over background
|
||||
darkText = this.blendColors(bg, darkText.slice(0, 3), (1 - darkText[3]) * 100);
|
||||
@@ -1312,7 +1327,7 @@
|
||||
let workspaceTheme = theme || workspace.theme;
|
||||
|
||||
await this.foreachWindowAsActive(async (browser) => {
|
||||
if (!browser.gZenThemePicker.promiseInitialized) {
|
||||
if (!browser.gZenThemePicker?.promiseInitialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1502,7 +1517,7 @@
|
||||
}
|
||||
|
||||
if (!skipUpdate) {
|
||||
this.dots = [];
|
||||
browser.gZenThemePicker.dots = [];
|
||||
browser.gZenThemePicker.recalculateDots(workspaceTheme.gradientColors);
|
||||
}
|
||||
});
|
||||
@@ -1596,7 +1611,7 @@
|
||||
currentWorkspace = await gZenWorkspaces.getActiveWorkspace();
|
||||
}
|
||||
|
||||
await this.onWorkspaceChange(currentWorkspace, true, skipSave ? gradient : null);
|
||||
await this.onWorkspaceChange(currentWorkspace, skipSave, skipSave ? gradient : null);
|
||||
}
|
||||
|
||||
async handlePanelClose() {
|
||||
|
||||
@@ -889,6 +889,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
async initializeWorkspaces() {
|
||||
let activeWorkspace = await this.getActiveWorkspace();
|
||||
this.activeWorkspace = activeWorkspace?.uuid;
|
||||
await gZenSessionStore.promiseInitialized;
|
||||
try {
|
||||
if (activeWorkspace) {
|
||||
window.gZenThemePicker = new nsZenThemePicker();
|
||||
@@ -897,7 +898,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
} catch (e) {
|
||||
console.error('gZenWorkspaces: Error initializing theme picker', e);
|
||||
}
|
||||
await gZenSessionStore.promiseInitialized;
|
||||
await this.workspaceBookmarks();
|
||||
await this.initializeTabsStripSections();
|
||||
this._initializeEmptyTab();
|
||||
|
||||
@@ -69,7 +69,7 @@
|
||||
|
||||
&:hover,
|
||||
&[dragged='true']{
|
||||
background-color: var(--zen-toolbar-element-bg);
|
||||
background-color: var(--toolbarbutton-hover-background);
|
||||
}
|
||||
|
||||
& label {
|
||||
@@ -215,7 +215,7 @@
|
||||
transition: opacity 0.1s;
|
||||
order: 5;
|
||||
--toolbarbutton-inner-padding: 6px;
|
||||
--tab-border-radius: 8px;
|
||||
--tab-border-radius: 6px;
|
||||
|
||||
:root[zen-renaming-tab='true'] & {
|
||||
display: none;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
"brandShortName": "Zen",
|
||||
"brandFullName": "Zen Browser",
|
||||
"release": {
|
||||
"displayVersion": "1.14.3b",
|
||||
"displayVersion": "1.14.4b",
|
||||
"github": {
|
||||
"repo": "zen-browser/desktop"
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user