Merge branch 'dev' into feature/tab-rename

This commit is contained in:
mr. m
2025-02-05 23:17:26 +01:00
committed by GitHub
14 changed files with 118 additions and 42 deletions

2
l10n

Submodule l10n updated: 0d64a530f4...fb2f27225e

View File

@@ -10,6 +10,7 @@ cd $CURRENT_DIR
LAST_FIREFOX_L10N_COMMIT=$(cat ./firefox-cache/l10n-last-commit-hash)
cd ./l10n
rm -rf firefox-l10n
# clone only from LAST_FIREFOX_L10N_COMMIT
git clone https://github.com/mozilla-l10n/firefox-l10n
cd firefox-l10n

View File

@@ -84,7 +84,7 @@ pref('zen.theme.accent-color', "#ffb787");
pref('zen.theme.content-element-separation', 6); // In pixels
pref('zen.theme.pill-button', false);
pref('zen.theme.gradient', true);
pref('zen.theme.essentials-favicon-bg', false);
pref('zen.theme.essentials-favicon-bg', true);
pref('zen.tabs.show-newtab-vertical', true);
pref('zen.view.show-newtab-button-border-top', false);
@@ -176,8 +176,8 @@ pref('zen.pinned-tab-manager.debug', false);
pref('zen.pinned-tab-manager.restore-pinned-tabs-to-pinned-url', false);
pref('zen.pinned-tab-manager.close-shortcut-behavior', 'switch');
// Pref to enable the new profiles (TODO: Check this out!)
//pref("browser.profiles.enabled", true);
// TODO: Check this out!
pref("browser.profiles.enabled", false);
// Zen webpanels (calling it sidebar due to legacy reasons)
pref('zen.sidebar.data', "{\"data\":\n {\"p1\":{\n \"url\":\"https://www.wikipedia.org/\"\n },\n\"p2\":{\n \"url\":\"https://m.twitter.com/\",\n\"ua\": true\n },\n\"p3\": {\n \"url\": \"https://www.youtube.com/\",\n\"ua\": true\n},\n\"p4\": {\n \"url\": \"https://translate.google.com/\",\n\"ua\": true\n},\n\"p5\": {\n \"url\": \"https://todoist.com/\",\n\"ua\": true\n}},\n\"index\":[\"p1\",\"p2\",\"p3\",\"p4\",\"p5\"]}");

View File

@@ -4,7 +4,7 @@ export var ZenCustomizableUI = new (class {
constructor() {}
TYPE_TOOLBAR = 'toolbar';
defaultSidebarIcons = ['zen-profile-button', 'zen-workspaces-button', 'downloads-button'];
defaultSidebarIcons = ['preferences-button', 'zen-workspaces-button', 'downloads-button'];
startup(CustomizableUIInternal) {
CustomizableUIInternal.registerArea(

View File

@@ -33,6 +33,8 @@
this._initSidebarScrolling();
gZenUIMigration.init();
gZenCompactModeManager.init();
ZenWorkspaces.init();
gZenVerticalTabsManager.init();

View File

@@ -1,11 +1,11 @@
diff --git a/browser/base/content/browser-init.js b/browser/base/content/browser-init.js
index 9df41bb3c82919839ee1408aa4d177ea7ee40a56..e37c64fa2c2ea39762be4285a1a7055463ded537 100644
index 63100defacf66c6b3232b9e0a783a5fd14e3a46a..eb7ed966628a595847b850f981418d425b78f14b 100644
--- a/browser/base/content/browser-init.js
+++ b/browser/base/content/browser-init.js
@@ -152,13 +152,15 @@ var gBrowserInit = {
elem.setAttribute("skipintoolbarset", "true");
}
}
@@ -162,13 +162,15 @@ var gBrowserInit = {
elem.setAttribute("skipintoolbarset", "true");
}
}
+ ZenCustomizableUI.init(window);
for (let area of CustomizableUI.areas) {
let type = CustomizableUI.getAreaType(area);
@@ -16,14 +16,15 @@ index 9df41bb3c82919839ee1408aa4d177ea7ee40a56..e37c64fa2c2ea39762be4285a1a70554
}
}
+ ZenCustomizableUI.registerToolbarNodes(window);
if (isVerticalTabs) {
// Show the vertical tabs toolbar
setToolbarVisibility(
@@ -253,6 +255,10 @@ var gBrowserInit = {
if (isVerticalTabs) {
// Show the vertical tabs toolbar
setToolbarVisibility(
@@ -287,6 +289,11 @@ var gBrowserInit = {
gPrivateBrowsingUI.init();
BrowserSearch.init();
BrowserPageActions.init();
+
+Services.scriptloader.loadSubScript("chrome://browser/content/zen-components/ZenUIMigration.mjs", window);
+Services.scriptloader.loadSubScript("chrome://browser/content/ZenStartup.mjs", window);
+Services.scriptloader.loadSubScript("chrome://browser/content/zenThemeModifier.js", window);
+

View File

@@ -4,6 +4,7 @@
content/browser/ZenStartup.mjs (content/ZenStartup.mjs)
content/browser/ZenUIManager.mjs (content/ZenUIManager.mjs)
content/browser/ZenCustomizableUI.sys.mjs (content/ZenCustomizableUI.sys.mjs)
content/browser/zen-components/ZenUIMigration.mjs (zen-components/ZenUIMigration.mjs)
content/browser/zen-components/ZenCompactMode.mjs (zen-components/ZenCompactMode.mjs)
content/browser/zen-components/ZenViewSplitter.mjs (zen-components/ZenViewSplitter.mjs)
content/browser/zen-components/ZenThemesCommon.mjs (zen-components/ZenThemesCommon.mjs)

View File

@@ -63,7 +63,7 @@
}
&:not([zen-right-side='true']) #navigator-toolbox {
left: calc(-1 * var(--zen-sidebar-width) + var(--zen-element-separation));
left: calc(-1 * var(--zen-sidebar-width) + 1px);
}
/* When we have multiple toolbars and the top-toolbar is NOT being hidden,
@@ -80,7 +80,7 @@
--zen-compact-float: calc(var(--zen-element-separation) + 1px);
&:not([animate='true']) {
right: calc(-1 * var(--zen-sidebar-width) + var(--zen-element-separation));
right: calc(-1 * var(--zen-sidebar-width) + 1px);
}
}

View File

@@ -131,6 +131,8 @@
--toolbarbutton-border-radius: 6px;
--urlbar-margin-inline: 1px !important;
--tab-icon-overlay-stroke: light-dark(white, black) !important;
--fp-contextmenu-border-radius: 8px;
--fp-contextmenu-padding: calc(4px - var(--fp-contextmenu-menuitem-border-width)) 0;
--fp-contextmenu-menuitem-border-radius: calc(4px + var(--fp-contextmenu-menuitem-border-width));

View File

@@ -100,8 +100,6 @@ var gZenCompactModeManager = {
},
updateCompactModeContext(isSingleToolbar) {
this.getAndApplySidebarWidth(); // Ignore return value
const IDs = [
'zen-context-menu-compact-mode-hide-sidebar',
'zen-context-menu-compact-mode-hide-toolbar',
@@ -176,21 +174,20 @@ var gZenCompactModeManager = {
{
ease: 'easeIn',
type: 'spring',
stiffness: 3000,
damping: 150,
mass: 1,
bounce: 0,
duration: 0.2,
}
)
.then(() => {
this.sidebar.removeAttribute('animate');
this.sidebar.style.transition = 'none';
this.sidebar.style.removeProperty('margin-right');
this.sidebar.style.removeProperty('margin-left');
this.sidebar.style.removeProperty('transform');
this._animating = false;
this.sidebar.style.transition = 'none';
setTimeout(() => {
this._animating = false;
this.sidebar.style.removeProperty('transition');
});
}, 100);
});
} else if (canHideSidebar && !isCompactMode) {
document.getElementById('browser').style.overflow = 'hidden';
@@ -211,9 +208,8 @@ var gZenCompactModeManager = {
{
ease: 'easeOut',
type: 'spring',
stiffness: 3000,
damping: 150,
mass: 1,
bounce: 0,
duration: 0.2,
}
)
.then(() => {

View File

@@ -0,0 +1,60 @@
{
const PREF_NAME = 'zen.migration.version';
const MIGRATION_VERSION = 1;
class ZenUIMigration {
init() {
if (Services.prefs.prefHasUserValue(PREF_NAME)) {
this._migrate();
}
this.clearVariables();
}
get _migrationVersion() {
return Services.prefs.getIntPref(PREF_NAME, 0);
}
set _migrationVersion(value) {
Services.prefs.setIntPref(PREF_NAME, value);
}
_migrate() {
if (this._migrationVersion < 1) {
this._migrateV1();
}
}
clearVariables() {
this._migrationVersion = MIGRATION_VERSION;
window.gZenUIMigration = null;
}
async _migrateV1() {
// Introduction of the new URL bar, show a message to the user
const notification = gNotificationBox.appendNotification(
'zen-new-urlbar-notification',
{
label: { 'l10n-id': 'zen-new-urlbar-notification' },
image: 'chrome://browser/skin/notification-icons/persistent-storage-blocked.svg',
priority: gNotificationBox.PRIORITY_WARNING_HIGH,
},
[
{
'l10n-id': 'zen-disable',
accessKey: 'D',
callback: () => {
Services.prefs.setBoolPref('zen.urlbar.replace-newtab', false);
},
},
{
link: 'https://docs.zen-browser.app/user-manual/urlbar/',
'l10n-id': 'zen-learn-more-text',
},
]
);
notification.persistence = -1;
}
}
window.gZenUIMigration = new ZenUIMigration();
}

View File

@@ -0,0 +1,13 @@
diff --git a/browser/components/sidebar/browser-sidebar.js b/browser/components/sidebar/browser-sidebar.js
index 1937a01b9940c79782cc2ad002b09ea5938b89e0..0846ab4b3750a556617ff8d4546d9131cda35296 100644
--- a/browser/components/sidebar/browser-sidebar.js
+++ b/browser/components/sidebar/browser-sidebar.js
@@ -671,7 +671,7 @@ var SidebarController = {
*/
setPosition() {
// First reset all ordinals to match DOM ordering.
- let browser = document.getElementById("browser");
+ let browser = document.getElementById("tabbrowser-tabbox");
[...browser.children].forEach((node, i) => {
node.style.order = i + 1;
});

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/urlbar/UrlbarInput.sys.mjs b/browser/components/urlbar/UrlbarInput.sys.mjs
index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf61913dcc 100644
index 50968dc04b527438acf30151f0c2e92f8b45097c..f8e8e9c06613c5d5f33333fd9e128a726c67e873 100644
--- a/browser/components/urlbar/UrlbarInput.sys.mjs
+++ b/browser/components/urlbar/UrlbarInput.sys.mjs
@@ -67,6 +67,13 @@ XPCOMUtils.defineLazyPreferenceGetter(
@@ -52,18 +52,19 @@ index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf
// Enable the animation only after the first extend call to ensure it
// doesn't run when opening a new window.
if (!this.hasAttribute("breakout-extend-animate")) {
@@ -2163,6 +2183,10 @@ export class UrlbarInput {
@@ -2163,6 +2183,11 @@ export class UrlbarInput {
return;
}
+ if (this._zenHandleUrlbarClose) {
+ this._zenHandleUrlbarClose();
+ }
+ this.removeAttribute("zen-floating-urlbar");
+
this.removeAttribute("breakout-extend");
this.#updateTextboxPosition();
}
@@ -3305,7 +3329,7 @@ export class UrlbarInput {
@@ -3305,7 +3330,7 @@ export class UrlbarInput {
} else {
where = lazy.BrowserUtils.whereToOpenLink(event, false, false);
}
@@ -72,7 +73,7 @@ index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf
if (where == "current") {
where = "tab";
} else if (where == "tab") {
@@ -3859,6 +3883,11 @@ export class UrlbarInput {
@@ -3859,6 +3884,11 @@ export class UrlbarInput {
}
_on_click(event) {
@@ -84,7 +85,7 @@ index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf
if (
event.target == this.inputField ||
event.target == this._inputContainer ||
@@ -3930,7 +3959,7 @@ export class UrlbarInput {
@@ -3930,7 +3960,7 @@ export class UrlbarInput {
}
}
@@ -93,7 +94,7 @@ index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf
this.view.autoOpen({ event });
} else {
if (this._untrimOnFocusAfterKeydown) {
@@ -3970,9 +3999,12 @@ export class UrlbarInput {
@@ -3970,9 +4000,12 @@ export class UrlbarInput {
}
_on_mousedown(event) {
@@ -107,7 +108,7 @@ index 50968dc04b527438acf30151f0c2e92f8b45097c..3db8b6c04ec5a1b88dc05d4ff04721cf
if (
event.target != this.inputField &&
@@ -3982,8 +4014,8 @@ export class UrlbarInput {
@@ -3982,8 +4015,8 @@ export class UrlbarInput {
break;
}

View File

@@ -1,5 +1,5 @@
diff --git a/browser/themes/shared/tabbrowser/tabs.css b/browser/themes/shared/tabbrowser/tabs.css
index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b587f1428 100644
index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..64487674de1afb711258a36757508cd9b741fcd9 100644
--- a/browser/themes/shared/tabbrowser/tabs.css
+++ b/browser/themes/shared/tabbrowser/tabs.css
@@ -33,7 +33,7 @@
@@ -37,16 +37,15 @@ index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b
&::before {
position: absolute;
@@ -511,7 +510,7 @@
@@ -511,7 +510,6 @@
background-repeat: no-repeat;
border-radius: 10px;
-moz-context-properties: fill;
- fill: var(--tab-icon-overlay-fill);
+ filter: invert(1);
}
}
@@ -569,14 +568,14 @@
@@ -569,14 +567,14 @@
}
&[textoverflow] {
@@ -65,7 +64,7 @@ index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b
direction: rtl;
mask-image: linear-gradient(to right, transparent, black var(--tab-label-mask-size));
}
@@ -1146,7 +1145,7 @@
@@ -1146,7 +1144,7 @@
margin-inline: var(--tab-inner-inline-margin);
#tabbrowser-tabs[orient="vertical"]:not([expanded]) & > .toolbarbutton-text {
@@ -74,7 +73,7 @@ index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b
}
&:hover {
@@ -1194,7 +1193,6 @@
@@ -1194,7 +1192,6 @@
}
#vertical-pinned-tabs-container {
@@ -82,7 +81,7 @@ index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b
display: none;
grid-template-columns: repeat(auto-fit, minmax(var(--tab-pinned-min-width-expanded), auto));
overflow-y: auto;
@@ -1347,7 +1345,7 @@
@@ -1347,7 +1344,7 @@
toolbarbutton:not(#firefox-view-button),
toolbarpaletteitem:not(#wrapper-firefox-view-button)
) ~ #tabbrowser-tabs {
@@ -91,7 +90,7 @@ index 96f930638c04c7ddcc8dc1a7fe4dce8b12a325e6..3c10b8f0d893d313fa208dba8f47007b
padding-inline-start: calc(var(--tab-overflow-pinned-tabs-width) + 2px);
margin-inline-start: 2px;
}
@@ -1381,7 +1379,6 @@ toolbar:not(#TabsToolbar) #firefox-view-button {
@@ -1381,7 +1378,6 @@ toolbar:not(#TabsToolbar) #firefox-view-button {
list-style-image: url(chrome://global/skin/icons/plus.svg);
}