This commit is contained in:
mr. m
2025-03-21 00:37:35 +01:00
16 changed files with 165 additions and 72 deletions

2
l10n

Submodule l10n updated: 7c14b58a28...778cb128c6

View File

@@ -90,6 +90,8 @@ pref('zen.tabs.show-newtab-vertical', true);
pref('zen.view.show-newtab-button-border-top', false);
pref('zen.view.show-newtab-button-top', true);
perf('zen.mediacontrols.enabled', true);
#ifdef MOZILLA_OFFICIAL
pref('zen.rice.api.url', 'https://share.zen-browser.app', locked);
pref('zen.injections.match-urls', 'https://zen-browser.app/*,https://share.zen-browser.app/*', locked);
@@ -199,7 +201,6 @@ pref('zen.startup.smooth-scroll-in-tabs', true);
// Zen Workspaces
pref('zen.workspaces.disabled_for_testing', false);
pref('zen.workspaces.hide-deactivated-workspaces', false);
pref('zen.workspaces.hide-default-container-indicator', true);
pref('zen.workspaces.force-container-workspace', false);
pref('zen.workspaces.open-new-tab-if-last-unpinned-tab-is-closed', false);

View File

@@ -5,7 +5,7 @@
*/
#PanelUI-zen-gradient-generator {
--panel-width: 300px;
--panel-width: 320px;
--panel-padding: 10px;
min-width: var(--panel-width);
}

View File

@@ -474,9 +474,6 @@
}
& #zen-workspaces-button {
margin-left: 2px;
margin-right: 2px;
& .zen-workspace-sidebar-icon[no-icon='true'] {
display: none;
}

View File

@@ -20,11 +20,13 @@
--toolbarbutton-hover-background: transparent !important;
border-radius: var(--zen-button-border-radius) !important;
background: transparent;
padding: 2px;
appearance: unset !important;
height: fit-content;
gap: 3px;
container-type: inline-size;
width: 100%;
& toolbarbutton {
margin: 0;
width: 25px;
@@ -34,8 +36,44 @@
align-items: center;
position: relative;
@media (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') {
&:not([active='true']):not(:hover) {
& .zen-workspace-icon[no-icon='true'] {
width: 6px;
height: 6px;
background: light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4));
border-radius: 50%;
}
filter: grayscale(1);
opacity: 0.5;
transition:
filter 0.2s,
opacity 0.2s,
width 0.1s;
&[active='true'],
&:hover {
filter: grayscale(0);
opacity: 1;
}
&:hover {
background-color: var(--zen-toolbar-element-bg);
}
}
&[overflow] {
gap: 0 !important;
& toolbarbutton {
margin: 0;
}
& toolbarbutton:not([active='true']),
&:has(toolbarbutton:hover) toolbarbutton[active='true'] {
&:not(:hover) {
width: min(var(--zen-overflowed-workspace-button-width), 25px);
min-width: 10px;
&::after {
content: '';
position: absolute;
@@ -58,33 +96,6 @@
}
}
}
& .zen-workspace-icon[no-icon='true'] {
width: 6px;
height: 6px;
background: light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4));
border-radius: 50%;
}
@media not (-moz-bool-pref: 'zen.workspaces.hide-deactivated-workspaces') {
& {
filter: grayscale(1);
opacity: 0.5;
transition:
filter 0.2s,
opacity 0.2s;
}
&[active='true'],
&:hover {
filter: grayscale(0);
opacity: 1;
}
&:hover {
background-color: var(--zen-toolbar-element-bg);
}
}
}
}
@@ -118,8 +129,6 @@
& #zen-workspaces-button {
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: flex;
gap: 0.5ch;
}

View File

@@ -500,9 +500,8 @@
const centerPosition = { x: rect.width / 2, y: rect.height / 2 };
const harmonyAngles = getColorHarmonyType(dots.length + (action === 'add' ? 1 : action === 'remove' ? -1 : 0), this.dots);
if (!harmonyAngles || harmonyAngles.angles.length === 0) return dots;
this.useAlgo = harmonyAngles.type;
if (!harmonyAngles || harmonyAngles.angles.length === 0) return dots;
let primaryDot = dots.find((dot) => dot.ID === 0);
if (!primaryDot) return [];
@@ -638,7 +637,7 @@
}
});
let colorPositions = this.calculateCompliments(this.dots, 'remove', this.useAlgo);
let colorPositions = this.calculateCompliments(this.dots, 'remove');
this.handleColorPositions(colorPositions);
this.updateCurrentWorkspace();
return;
@@ -780,7 +779,7 @@
}
});
let colorPositions = this.calculateCompliments(this.dots, 'remove', this.useAlgo);
let colorPositions = this.calculateCompliments(this.dots, 'remove');
this.handleColorPositions(colorPositions);
this.updateCurrentWorkspace();

View File

@@ -21,6 +21,8 @@ class ZenMediaController {
_controllerSwitchTimeout = null;
init() {
if (!Services.prefs.getBoolPref('zen.mediacontrols.enabled', true)) return;
this.mediaTitle = document.querySelector('#zen-media-title');
this.mediaArtist = document.querySelector('#zen-media-artist');
this.mediaControlBar = document.querySelector('#zen-media-controls-toolbar');
@@ -58,16 +60,8 @@ class ZenMediaController {
}
});
window.addEventListener('TabClose', (event) => {
const linkedBrowser = event.target.linkedBrowser;
if (!linkedBrowser?.browsingContext?.mediaController) return;
this.deinitMediaController(
linkedBrowser.browsingContext.mediaController,
true,
linkedBrowser.browserId === this._currentBrowser?.browserId,
true
);
});
const onTabDiscardedOrClosed = this.onTabDiscardedOrClosed.bind(this);
window.addEventListener('TabClose', onTabDiscardedOrClosed);
window.addEventListener('DOMAudioPlaybackStarted', (event) => {
setTimeout(() => {
@@ -89,6 +83,17 @@ class ZenMediaController {
window.addEventListener('DOMAudioPlaybackStopped', () => this.updateMuteState());
}
onTabDiscardedOrClosed(event) {
const linkedBrowser = event.target.linkedBrowser;
if (!linkedBrowser?.browsingContext?.mediaController) return;
this.deinitMediaController(
linkedBrowser.browsingContext.mediaController,
true,
linkedBrowser.browserId === this._currentBrowser?.browserId,
true
);
}
async deinitMediaController(mediaController, shouldForget = true, shouldOverride = true, shouldHide = true) {
if (!mediaController) return;

View File

@@ -22,8 +22,6 @@
'TabAttrModified',
'TabPinned',
'TabUnpinned',
'TabBrowserInserted',
'TabBrowserDiscarded',
'TabShow',
'TabHide',
'TabOpen',
@@ -150,8 +148,6 @@
switch (action) {
case 'TabPinned':
case 'TabUnpinned':
case 'TabBrowserInserted':
case 'TabBrowserDiscarded':
case 'TabShow':
case 'TabHide':
break;
@@ -265,9 +261,9 @@
tab.selected ||
(tab.multiselected && !ignoreTimestamp) ||
(tab.hasAttribute('busy') && !ignoreTimestamp) ||
tab.hasAttribute('pending') ||
!tab.linkedPanel ||
tab.splitView ||
tab.group?.hasAttribute('split-view-group') ||
tab.attention ||
tab.hasAttribute('glance-id') ||
tab.linkedBrowser?.zenModeActive ||
@@ -293,8 +289,8 @@
_tabPermitsUnload(tab, extraArgs) {
return typeof extraArgs.permitUnload === 'undefined'
? !tab.linkedBrowser?.permitUnload()?.permitUnload
: !extraArgs.permitUnload;
? tab.linkedBrowser?.permitUnload()?.permitUnload
: extraArgs.permitUnload;
}
}

View File

@@ -77,6 +77,8 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
);
ChromeUtils.defineLazyGetter(this, 'tabContainer', () => document.getElementById('tabbrowser-tabs'));
this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', '');
window.addEventListener('resize', this.onWindowResize.bind(this));
}
async afterLoadInit() {
@@ -599,6 +601,7 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
} catch (e) {
console.error('ZenWorkspaces: Error initializing theme picker', e);
}
this.onWindowResize();
await this._selectStartPage();
this._fixTabPositions();
this._resolveInitialized();
@@ -2368,4 +2371,21 @@ var ZenWorkspaces = new (class extends ZenMultiWindowFeature {
const workspace = workspaces.workspaces.find((workspace) => workspace.uuid === activeWorkspace);
return workspace.containerTabId;
}
onWindowResize() {
// Check if workspace icons overflow the parent container
const parent = document.getElementById('zen-workspaces-button');
if (!parent) {
return;
}
// Once we are overflowing, we align the buttons to always stay inside the container,
// meaning we need to remove the overflow attribute to reset the width
parent.removeAttribute('overflow');
const overflow = parent.scrollWidth > parent.clientWidth;
parent.toggleAttribute('overflow', overflow);
// The maximum width a button has when it overflows based on the number of buttons
const numButtons = parent.children.length + 1; // +1 to exclude the active button
const maxWidth = 100 / numButtons;
parent.style.setProperty('--zen-overflowed-workspace-button-width', `${maxWidth}%`);
}
})();

View File

@@ -959,11 +959,6 @@ Preferences.addAll([
type: 'int',
default: 10,
},
{
id: 'zen.workspaces.hide-deactivated-workspaces',
type: 'bool',
default: true,
},
{
id: 'zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url',
type: 'bool',

View File

@@ -23,9 +23,6 @@
<checkbox id="zenWorkspacesForceContainerTabsToWorkspace"
data-l10n-id="zen-settings-workspaces-force-container-tabs-to-workspace"
preference="zen.workspaces.force-container-workspace"/>
<checkbox id="zenWorkspaceHideDeactivatedWorkspaces"
data-l10n-id="zen-settings-workspaces-hide-deactivated-workspaces"
preference="zen.workspaces.hide-deactivated-workspaces"/>
</groupbox>
<hbox id="zenTabsUnloadCategory"

View File

@@ -1,8 +1,15 @@
diff --git a/browser/themes/windows/browser.css b/browser/themes/windows/browser.css
index f49604e53780763b9aa19897458c45f0be6cbc9b..aa9da99641ba4a3b7f67a27acbbf6c75c1346ced 100644
index f49604e53780763b9aa19897458c45f0be6cbc9b..5ea9098a9b689470ef4ddfea91069cd23391d020 100644
--- a/browser/themes/windows/browser.css
+++ b/browser/themes/windows/browser.css
@@ -47,7 +47,7 @@
@@ -40,14 +40,13 @@
* override these on the tabs toolbar because the accent color is
* arbitrary, so the hardcoded colors from browser-custom-colors might
* not provide sufficient contrast. */
- --toolbarbutton-icon-fill: currentColor;
--toolbarbutton-hover-background: color-mix(in srgb, currentColor 17%, transparent);
--toolbarbutton-active-background: color-mix(in srgb, currentColor 30%, transparent);
}
}
&[sizemode="normal"] #navigator-toolbox {

View File

@@ -0,0 +1,16 @@
diff --git a/toolkit/components/pictureinpicture/content/player.js b/toolkit/components/pictureinpicture/content/player.js
index 9a4971d5d24dba6e543be8ea321c6be8c43ad859..b0788967e51736b1ec95daf96a1504bfd7c1dea7 100644
--- a/toolkit/components/pictureinpicture/content/player.js
+++ b/toolkit/components/pictureinpicture/content/player.js
@@ -722,6 +722,11 @@ let Player = {
document.getElementById("large").click();
break;
}
+
+ case "minimize": {
+ this.closePipWindow({ reason: "CloseButton" });
+ break;
+ }
}
// If the click came from a element that is not inside the subtitles settings panel
// then we want to hide the panel

View File

@@ -0,0 +1,29 @@
diff --git a/toolkit/components/pictureinpicture/content/player.xhtml b/toolkit/components/pictureinpicture/content/player.xhtml
index 440ce51e8e67e4d3a7bdcb78f38f2fb6684c9848..6b48a3178f9de460dd3b08728f5638ef2751de21 100644
--- a/toolkit/components/pictureinpicture/content/player.xhtml
+++ b/toolkit/components/pictureinpicture/content/player.xhtml
@@ -52,13 +52,22 @@
tabindex="10"
#endif
/>
- <button id="unpip"
- class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-unpip-btn" data-l10n-attrs="tooltip"
+ <button id="minimize"
+ class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-minimize-btn" data-l10n-attrs="tooltip"
#ifdef XP_MACOSX
mac="true"
tabindex="10"
#else
tabindex="9"
+#endif
+ />
+ <button id="unpip"
+ class="control-item control-button tooltip-under-controls" data-l10n-id="pictureinpicture-unpip-btn" data-l10n-attrs="tooltip"
+#ifdef XP_MACOSX
+ mac="true"
+ tabindex="11"
+#else
+ tabindex="10"
#endif
/>
<div id="controls-bottom-gradient" class="control-item"></div>

View File

@@ -0,0 +1,22 @@
diff --git a/toolkit/themes/shared/pictureinpicture/player.css b/toolkit/themes/shared/pictureinpicture/player.css
index a3ffe31d47cc81a0cb578acc9177aaa6f41668eb..cf69507804b7c50f9afcfabb744098cfbe409396 100644
--- a/toolkit/themes/shared/pictureinpicture/player.css
+++ b/toolkit/themes/shared/pictureinpicture/player.css
@@ -724,3 +724,17 @@ input:checked + .slider::before {
justify-self: center;
}
}
+
+#minimize {
+ background-image: url("chrome://browser/skin/zen-icons/unpin.svg");
+ background-color: rgba(255, 255, 255, .8);
+ position: absolute;
+ fill: var(--close-btn-fill-color);
+ right: 50px;
+ top: 10px;
+}
+
+#minimize[mac="true"] {
+ right: auto;
+ left: 50px;
+}

View File

@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.10b",
"displayVersion": "1.10.1b",
"github": {
"repo": "zen-browser/desktop"
},
@@ -39,7 +39,7 @@
"brandShortName": "Twilight",
"brandFullName": "Zen Twilight",
"release": {
"displayVersion": "1.10t",
"displayVersion": "1.10.1t",
"github": {
"repo": "zen-browser/desktop"
}
@@ -53,4 +53,4 @@
"licenseType": "MPL-2.0"
},
"updateHostname": "updates.zen-browser.app"
}
}