From 123128bfc7e867629831015647f6ef518be78757 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sat, 15 Feb 2025 18:37:13 +0100 Subject: [PATCH 01/31] Added support for macos monochrome titlebar buttons, on by default --- src/browser/app/profile/zen-browser.js | 1 + .../content/zen-styles/zen-browser-ui.css | 24 +++++++++++++++-- .../base/zen-components/ZenCompactMode.mjs | 8 ++++-- .../libpref/init/StaticPrefList-yaml.patch | 13 +++------ src/widget/cocoa/nsCocoaWindow-mm.patch | 27 ------------------- 5 files changed, 32 insertions(+), 41 deletions(-) delete mode 100644 src/widget/cocoa/nsCocoaWindow-mm.patch diff --git a/src/browser/app/profile/zen-browser.js b/src/browser/app/profile/zen-browser.js index e0d21b352..fb124d615 100644 --- a/src/browser/app/profile/zen-browser.js +++ b/src/browser/app/profile/zen-browser.js @@ -143,6 +143,7 @@ pref('zen.view.sidebar-expanded.max-width', 500); #ifdef XP_MACOSX pref('zen.view.mac.show-three-dot-menu', false); +pref('zen.widget.mac.mono-window-controls', true); #endif pref('zen.view.show-bottom-border', false); pref('zen.view.use-single-toolbar', true); diff --git a/src/browser/base/content/zen-styles/zen-browser-ui.css b/src/browser/base/content/zen-styles/zen-browser-ui.css index 0257ac92f..92f956bea 100644 --- a/src/browser/base/content/zen-styles/zen-browser-ui.css +++ b/src/browser/base/content/zen-styles/zen-browser-ui.css @@ -152,12 +152,32 @@ gap: var(--zen-element-separation); } -.titlebar-buttonbox-container { - height: 100%; +@media not (-moz-platform: macos) { + .titlebar-buttonbox-container { + height: 100%; + } } @media (-moz-platform: macos) { .titlebar-buttonbox-container { margin-inline-end: 8px; + + & > .titlebar-buttonbox { + margin-inline-start: var(--zen-toolbox-padding); + } + } + + @media (-moz-bool-pref: 'zen.widget.mac.mono-window-controls') { + .titlebar-buttonbox-container { + /* Draw 3 dots as background to represent the window controls, + all with the same cololr as the titlebar */ + background-image: radial-gradient(circle, #4d4c4a 6px, transparent 0.5px); + background-size: 20px 22px; + background-position: 52% 50%; + + &:not([zen-has-hover='true']) > .titlebar-buttonbox { + opacity: 0; + } + } } } diff --git a/src/browser/base/zen-components/ZenCompactMode.mjs b/src/browser/base/zen-components/ZenCompactMode.mjs index 56bf32ecb..d510aed56 100644 --- a/src/browser/base/zen-components/ZenCompactMode.mjs +++ b/src/browser/base/zen-components/ZenCompactMode.mjs @@ -292,6 +292,9 @@ var gZenCompactModeManager = { element: document.getElementById('zen-appcontent-navbar-container'), screenEdge: 'top', }, + { + element: gZenVerticalTabsManager.actualWindowButtons, + } ]; }, @@ -336,8 +339,9 @@ var gZenCompactModeManager = { target.addEventListener('mouseleave', (event) => { // If on Mac, ignore mouseleave in the area of window buttons if (AppConstants.platform == 'macosx') { - const MAC_WINDOW_BUTTONS_X_BORDER = 75; - const MAC_WINDOW_BUTTONS_Y_BORDER = 40; + const buttonRect = gZenVerticalTabsManager.actualWindowButtons.getBoundingClientRect(); + const MAC_WINDOW_BUTTONS_X_BORDER = buttonRect.width + buttonRect.x; + const MAC_WINDOW_BUTTONS_Y_BORDER = buttonRect.height + buttonRect.y; if (event.clientX < MAC_WINDOW_BUTTONS_X_BORDER && event.clientY < MAC_WINDOW_BUTTONS_Y_BORDER) { return; } diff --git a/src/modules/libpref/init/StaticPrefList-yaml.patch b/src/modules/libpref/init/StaticPrefList-yaml.patch index fadcff2b1..ac8018292 100644 --- a/src/modules/libpref/init/StaticPrefList-yaml.patch +++ b/src/modules/libpref/init/StaticPrefList-yaml.patch @@ -1,8 +1,8 @@ diff --git a/modules/libpref/init/StaticPrefList.yaml b/modules/libpref/init/StaticPrefList.yaml -index 7364514f74703184462e8dbce3f0aafc3f850a3d..560671beddf6c216e918a47bd5dbd4e770a24ec7 100644 +index ce2393978f77f55f42ae9b97e5d40328ce8eaae4..a426679de76c2d172974ec87f5fe48e22d5ab7b0 100644 --- a/modules/libpref/init/StaticPrefList.yaml +++ b/modules/libpref/init/StaticPrefList.yaml -@@ -18067,7 +18067,7 @@ +@@ -18060,7 +18060,7 @@ # Whether we use the mica backdrop. Off by default for now. - name: widget.windows.mica type: bool @@ -11,7 +11,7 @@ index 7364514f74703184462e8dbce3f0aafc3f850a3d..560671beddf6c216e918a47bd5dbd4e7 mirror: once #endif -@@ -18180,6 +18180,26 @@ +@@ -18173,6 +18173,19 @@ mirror: always #endif @@ -21,13 +21,6 @@ index 7364514f74703184462e8dbce3f0aafc3f850a3d..560671beddf6c216e918a47bd5dbd4e7 + value: true + mirror: never + -+#ifdef XP_MACOSX -+- name: zen.widget.mac.mono-window-controls -+ type: RelaxedAtomicBool -+ value: false -+ mirror: always -+#endif -+ +#ifdef XP_WIN +- name: zen.widget.windows.acrylic + type: bool diff --git a/src/widget/cocoa/nsCocoaWindow-mm.patch b/src/widget/cocoa/nsCocoaWindow-mm.patch deleted file mode 100644 index 071a19813..000000000 --- a/src/widget/cocoa/nsCocoaWindow-mm.patch +++ /dev/null @@ -1,27 +0,0 @@ -diff --git a/widget/cocoa/nsCocoaWindow.mm b/widget/cocoa/nsCocoaWindow.mm -index f1c87dd8faef8c6caf9248ce7d9f40c12f5db9f6..f5280b8fc6cf46d3941d1ff04835b12dd2755170 100644 ---- a/widget/cocoa/nsCocoaWindow.mm -+++ b/widget/cocoa/nsCocoaWindow.mm -@@ -51,6 +51,7 @@ - #include "mozilla/ScopeExit.h" - #include "mozilla/StaticPrefs_gfx.h" - #include "mozilla/StaticPrefs_widget.h" -+#include "mozilla/StaticPrefs_zen.h" - #include "mozilla/WritingModes.h" - #include "mozilla/layers/CompositorBridgeChild.h" - #include "mozilla/widget/Screen.h" -@@ -682,9 +683,11 @@ static unsigned int WindowMaskForBorderStyle(BorderStyle aBorderStyle) { - continue; - } - NSWindow* win = ancestor->GetCocoaWindow(); -- [[win standardWindowButton:NSWindowCloseButton] setEnabled:!aModal]; -- [[win standardWindowButton:NSWindowMiniaturizeButton] setEnabled:!aModal]; -- [[win standardWindowButton:NSWindowZoomButton] setEnabled:!aModal]; -+ -+ auto zenBtnEnabled = StaticPrefs::zen_widget_mac_mono_window_controls() ? false : !aModal; -+ [[win standardWindowButton:NSWindowCloseButton] setEnabled:zenBtnEnabled]; -+ [[win standardWindowButton:NSWindowMiniaturizeButton] setEnabled:zenBtnEnabled]; -+ [[win standardWindowButton:NSWindowZoomButton] setEnabled:zenBtnEnabled]; - } - if (aModal) { - mWindow.level = NSModalPanelWindowLevel; From 894d237841c5ef1f64d9521cfbd609378200c593 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sat, 15 Feb 2025 18:48:31 +0100 Subject: [PATCH 02/31] Fixed havhing monochrome titlebar buttons not being disabled --- .../base/content/zen-styles/zen-browser-ui.css | 3 ++- src/browser/base/zen-components/ZenCompactMode.mjs | 13 +++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-browser-ui.css b/src/browser/base/content/zen-styles/zen-browser-ui.css index 92f956bea..d4ca2ea19 100644 --- a/src/browser/base/content/zen-styles/zen-browser-ui.css +++ b/src/browser/base/content/zen-styles/zen-browser-ui.css @@ -152,7 +152,7 @@ gap: var(--zen-element-separation); } -@media not (-moz-platform: macos) { +@media not (-moz-platform: macos) { .titlebar-buttonbox-container { height: 100%; } @@ -161,6 +161,7 @@ @media (-moz-platform: macos) { .titlebar-buttonbox-container { margin-inline-end: 8px; + padding: 3px 0; & > .titlebar-buttonbox { margin-inline-start: var(--zen-toolbox-padding); diff --git a/src/browser/base/zen-components/ZenCompactMode.mjs b/src/browser/base/zen-components/ZenCompactMode.mjs index d510aed56..7e0c35b97 100644 --- a/src/browser/base/zen-components/ZenCompactMode.mjs +++ b/src/browser/base/zen-components/ZenCompactMode.mjs @@ -294,7 +294,7 @@ var gZenCompactModeManager = { }, { element: gZenVerticalTabsManager.actualWindowButtons, - } + }, ]; }, @@ -343,7 +343,16 @@ var gZenCompactModeManager = { const MAC_WINDOW_BUTTONS_X_BORDER = buttonRect.width + buttonRect.x; const MAC_WINDOW_BUTTONS_Y_BORDER = buttonRect.height + buttonRect.y; if (event.clientX < MAC_WINDOW_BUTTONS_X_BORDER && event.clientY < MAC_WINDOW_BUTTONS_Y_BORDER) { - return; + // Also check if it has gone from the top or left if we are exiting the titlebar + // button area + if ( + !( + target.classList.contains('titlebar-buttonbox-container') && + (event.clientX < buttonRect.x || event.clientY < buttonRect.y) + ) + ) { + return; + } } } From 4d364acc1d280977a4fd93d91636be9316510e88 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 15 Feb 2025 01:08:40 +0100 Subject: [PATCH 03/31] merge --- .../tabbrowser/content/tabbrowser-js.patch | 89 +++++++++++-------- 1 file changed, 51 insertions(+), 38 deletions(-) diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index 6790f1ba4..43ac69e29 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,8 +1,8 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b62093051cc9a 100644 +index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f13966d8e2 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js -@@ -406,11 +406,39 @@ +@@ -406,11 +406,52 @@ return this.tabContainer.visibleTabs; } @@ -13,6 +13,19 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 + break; + } + if (!tab.hidden) { ++ i += !tab.hasAttribute("zen-glance-tab"); ++ } ++ } ++ return i; ++ } ++ ++ get _numVisiblePinTabsWithoutGlance() { ++ let i = 0; ++ for (let tab of this.tabs) { ++ if (!tab.pinned) { ++ break; ++ } ++ if (!tab.hidden && !tab.hasAttribute("zen-glance-tab")) { + i++; + } + } @@ -26,7 +39,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 + break; + } + if (!tab.hidden) { -+ i++; ++ i += !tab.hasAttribute("zen-glance-tab"); + } + } + return i; @@ -40,11 +53,11 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 + if (!tab.pinned && !tab.hasAttribute("zen-glance-tab")) { break; } -+ i++; ++ i += !tab.hasAttribute("zen-glance-tab"); } return i; } -@@ -807,7 +835,7 @@ +@@ -807,7 +848,7 @@ this.showTab(aTab); if (this.tabContainer.verticalMode) { this._handleTabMove(aTab, () => @@ -53,7 +66,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 ); } else { this.moveTabTo(aTab, this.pinnedTabCount, { forceStandaloneTab: true }); -@@ -828,7 +856,7 @@ +@@ -828,7 +869,7 @@ // the moving of a tab from the vertical pinned tabs container // and back into arrowscrollbox. aTab.removeAttribute("pinned"); @@ -62,7 +75,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 }); } else { this.moveTabTo(aTab, this.pinnedTabCount - 1, { -@@ -1055,6 +1083,8 @@ +@@ -1055,6 +1096,8 @@ let LOCAL_PROTOCOLS = ["chrome:", "about:", "resource:", "data:"]; @@ -71,7 +84,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if ( aIconURL && !aLoadingPrincipal && -@@ -1065,6 +1095,9 @@ +@@ -1065,6 +1108,9 @@ ); return; } @@ -81,7 +94,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 let browser = this.getBrowserForTab(aTab); browser.mIconURL = aIconURL; -@@ -1310,6 +1343,7 @@ +@@ -1310,6 +1356,7 @@ if (!this._previewMode) { newTab.recordTimeFromUnloadToReload(); newTab.updateLastAccessed(); @@ -89,7 +102,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 oldTab.updateLastAccessed(); // if this is the foreground window, update the last-seen timestamps. if (this.ownerGlobal == BrowserWindowTracker.getTopWindow()) { -@@ -1462,6 +1496,9 @@ +@@ -1462,6 +1509,9 @@ } let activeEl = document.activeElement; @@ -99,7 +112,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 // If focus is on the old tab, move it to the new tab. if (activeEl == oldTab) { newTab.focus(); -@@ -2387,7 +2424,7 @@ +@@ -2387,7 +2437,7 @@ let panel = this.getPanel(browser); let uniqueId = this._generateUniquePanelID(); @@ -108,7 +121,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 aTab.linkedPanel = uniqueId; // Inject the into the DOM if necessary. -@@ -2446,8 +2483,8 @@ +@@ -2446,8 +2496,8 @@ // If we transitioned from one browser to two browsers, we need to set // hasSiblings=false on both the existing browser and the new browser. if (this.tabs.length == 2) { @@ -119,7 +132,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 } else { aTab.linkedBrowser.browsingContext.hasSiblings = this.tabs.length > 1; } -@@ -2679,6 +2716,12 @@ +@@ -2679,6 +2729,12 @@ ); } @@ -132,7 +145,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (!UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.start("browser.tabs.opening", "initting", window); } -@@ -2742,6 +2785,12 @@ +@@ -2742,6 +2798,12 @@ noInitialLabel, skipBackgroundNotify, }); @@ -145,7 +158,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (insertTab) { // insert the tab into the tab container in the correct position this._insertTabAtIndex(t, { -@@ -2885,6 +2934,9 @@ +@@ -2885,6 +2947,9 @@ } } @@ -155,7 +168,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 // Additionally send pinned tab events if (pinned) { this._notifyPinnedStatus(t); -@@ -3403,6 +3455,21 @@ +@@ -3403,6 +3468,21 @@ ) { tabWasReused = true; tab = this.selectedTab; @@ -177,7 +190,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (!tabData.pinned) { this.unpinTab(tab); } else { -@@ -3416,6 +3483,7 @@ +@@ -3416,6 +3496,7 @@ restoreTabsLazily && !select && !tabData.pinned; let url = "about:blank"; @@ -185,7 +198,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (tabData.entries?.length) { let activeIndex = (tabData.index || tabData.entries.length) - 1; // Ensure the index is in bounds. -@@ -3451,7 +3519,21 @@ +@@ -3451,7 +3532,21 @@ skipLoad: true, preferredRemoteType, }); @@ -208,7 +221,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (select) { tabToSelect = tab; } -@@ -3464,8 +3546,8 @@ +@@ -3464,8 +3559,8 @@ // inserted in the DOM. If the tab is not yet in the DOM, // just insert it in the right place from the start. if (!tab.parentNode) { @@ -219,7 +232,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 tab.toggleAttribute("pinned", true); this.tabContainer._invalidateCachedTabs(); // Then ensure all the tab open/pinning information is sent. -@@ -3729,7 +3811,7 @@ +@@ -3729,7 +3824,7 @@ // Ensure we have an index if one was not provided. if (typeof index != "number") { // Move the new tab after another tab if needed, to the end otherwise. @@ -228,7 +241,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if ( !bulkOrderedOpen && ((openerTab && -@@ -3780,7 +3862,7 @@ +@@ -3780,7 +3875,7 @@ } /** @type {MozTabbrowserTab|undefined} */ @@ -237,7 +250,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 this.tabContainer._invalidateCachedTabs(); if (tabGroup) { -@@ -4095,6 +4177,9 @@ +@@ -4095,6 +4190,9 @@ return; } @@ -247,7 +260,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 this.removeTabs(selectedTabs); } -@@ -4427,6 +4512,7 @@ +@@ -4427,6 +4525,7 @@ skipSessionStore, } = {} ) { @@ -255,7 +268,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (UserInteraction.running("browser.tabs.opening", window)) { UserInteraction.finish("browser.tabs.opening", window); } -@@ -4443,6 +4529,12 @@ +@@ -4443,6 +4542,12 @@ TelemetryStopwatch.start("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); } @@ -268,7 +281,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 // Handle requests for synchronously removing an already // asynchronously closing tab. if (!animate && aTab.closing) { -@@ -4457,7 +4549,9 @@ +@@ -4457,7 +4562,9 @@ // frame created for it (for example, by updating the visually selected // state). let tabWidth = window.windowUtils.getBoundsWithoutFlushing(aTab).width; @@ -279,7 +292,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if ( !this._beginRemoveTab(aTab, { closeWindowFastpath: true, -@@ -4471,7 +4565,6 @@ +@@ -4471,7 +4578,6 @@ TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab); return; } @@ -287,7 +300,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 let lockTabSizing = !this.tabContainer.verticalMode && !aTab.pinned && -@@ -4610,14 +4703,14 @@ +@@ -4610,14 +4716,14 @@ !!this.tabsInCollapsedTabGroups.length; if ( aTab.visible && @@ -304,7 +317,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (closeWindow) { // We've already called beforeunload on all the relevant tabs if we get here, -@@ -4812,6 +4905,8 @@ +@@ -4812,6 +4918,8 @@ this.tabs[i]._tPos = i; } @@ -313,7 +326,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (!this._windowIsClosing) { if (wasPinned) { this.tabContainer._positionPinnedTabs(); -@@ -5465,10 +5560,10 @@ +@@ -5465,10 +5573,10 @@ SessionStore.deleteCustomTabValue(aTab, "hiddenBy"); } @@ -326,19 +339,19 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 aTab.selected || aTab.closing || // Tabs that are sharing the screen, microphone or camera cannot be hidden. -@@ -5706,9 +5801,9 @@ +@@ -5706,9 +5814,9 @@ // Don't allow mixing pinned and unpinned tabs. if (aTab.pinned) { - aIndex = Math.min(aIndex, this.pinnedTabCount - 1); -+ aIndex = Math.min(aIndex, this._numVisiblePinTabs - 1); ++ aIndex = Math.min(aIndex, (aTab.hasAttribute('zen-essential') ? this._numZenEssentials : this._numVisiblePinTabsWithoutGlance) - 1); } else { - aIndex = Math.max(aIndex, this.pinnedTabCount); -+ aIndex = Math.max(aIndex, this._numVisiblePinTabs); ++ aIndex = Math.max(aIndex, this._numVisiblePinTabsWithoutGlance); } if (aTab._tPos == aIndex) { return; -@@ -5727,6 +5822,9 @@ +@@ -5727,6 +5835,9 @@ this.tabContainer.insertBefore(aTab, neighbor); } }); @@ -348,7 +361,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 } moveTabToGroup(aTab, aGroup) { -@@ -5802,7 +5900,7 @@ +@@ -5802,7 +5913,7 @@ createLazyBrowser, }; @@ -357,7 +370,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 if (aIndex < numPinned || (aTab.pinned && aIndex == numPinned)) { params.pinned = true; } -@@ -7443,6 +7541,7 @@ +@@ -7443,6 +7554,7 @@ aWebProgress.isTopLevel ) { this.mTab.setAttribute("busy", "true"); @@ -365,7 +378,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 gBrowser._tabAttrModified(this.mTab, ["busy"]); this.mTab._notselectedsinceload = !this.mTab.selected; gBrowser.syncThrobberAnimations(this.mTab); -@@ -8411,7 +8510,7 @@ var TabContextMenu = { +@@ -8411,7 +8523,7 @@ var TabContextMenu = { ); contextUnpinSelectedTabs.hidden = !this.contextTab.pinned || !multiselectionContext; @@ -374,7 +387,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 // Move Tab items let contextMoveTabOptions = document.getElementById( "context_moveTabOptions" -@@ -8444,7 +8543,7 @@ var TabContextMenu = { +@@ -8444,7 +8556,7 @@ var TabContextMenu = { let contextMoveTabToStart = document.getElementById("context_moveToStart"); let isFirstTab = tabsToMove[0] == visibleTabs[0] || @@ -383,7 +396,7 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..5db2380df21f4b25a6c03bfa457b6209 contextMoveTabToStart.disabled = isFirstTab && allSelectedTabsAdjacent; document.getElementById("context_openTabInWindow").disabled = -@@ -8677,6 +8776,7 @@ var TabContextMenu = { +@@ -8677,6 +8789,7 @@ var TabContextMenu = { if (this.contextTab.multiselected) { gBrowser.removeMultiSelectedTabs(); } else { From 8e6b4515ed9da54f601321c6229e82a7bbd90c2c Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 15 Feb 2025 01:26:32 +0100 Subject: [PATCH 04/31] Refactor vertical-tabs.css to enhance tab background styling and improve layout consistency --- .../zen-styles/zen-tabs/vertical-tabs.css | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css index 286493476..7f0312f38 100644 --- a/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css +++ b/src/browser/base/content/zen-styles/zen-tabs/vertical-tabs.css @@ -280,10 +280,6 @@ } } - &[selected] .tab-background { - backdrop-filter: blur(10px); - } - @media (-moz-bool-pref: 'zen.tabs.dim-pending') { &[pending='true'] .tab-icon-image { opacity: 0.5; @@ -326,13 +322,18 @@ /* On essentials, glance tabs are floating */ &[zen-essential='true'] .tabbrowser-tab { position: absolute; - top: 4px; - right: 4px; - --tab-collapsed-width: 35px; + top: 0px; + right: 0px; + --tab-collapsed-width: 34px; --tab-min-height: 16px; width: var(--tab-collapsed-width) !important; z-index: 1; pointer-events: none; + & .tab-background { + /* Solid colors because we don't want to show the background */ + background: light-dark(rgb(249, 249, 249), rgb(63, 63, 63)) !important; + border: 2px solid light-dark(rgba(0, 0, 0, 0.4), rgba(255, 255, 255, 0.4)); + } } } } @@ -954,7 +955,7 @@ padding: 0; } -#zen-essentials-container .tabbrowser-tab { +#zen-essentials-container > .tabbrowser-tab { --toolbarbutton-inner-padding: 0; max-width: unset; width: 100% !important; @@ -994,7 +995,7 @@ } @media (-moz-bool-pref: 'zen.theme.essentials-favicon-bg') { - &[visuallyselected] .tab-background { + &[visuallyselected] > .tab-stack > .tab-background { &::after { content: ""; inset: -50%; From 6b3e0c4ac45b72fb4c658ac7420da848a73e76e6 Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 15 Feb 2025 01:29:45 +0100 Subject: [PATCH 05/31] Remove update-submodules workflow file to streamline CI processes --- .github/workflows/update-submodules.yml | 31 ------------------------- 1 file changed, 31 deletions(-) delete mode 100644 .github/workflows/update-submodules.yml diff --git a/.github/workflows/update-submodules.yml b/.github/workflows/update-submodules.yml deleted file mode 100644 index 18fa6cc26..000000000 --- a/.github/workflows/update-submodules.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: Update Components Submodules - -on: - push: - branches: - - dev - workflow_dispatch: - workflow_call: - -jobs: - update-submodules: - runs-on: ubuntu-latest - if: "!contains(github.event.head_commit.message, '[skip ci]')" - - steps: - - name: Checkout repository - uses: actions/checkout@v4 - with: - submodules: recursive - token: ${{ secrets.DEPLOY_KEY }} - - - name: Update submodules - run: | - git submodule update --remote --merge - - - name: Commit - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: '[skip ci] 📦 Update submodules' - commit_user_name: Zen Browser Robot - commit_user_email: zen-browser-auto@users.noreply.github.com From c7bd7d0bf65079f726474f6de646409abf68729a Mon Sep 17 00:00:00 2001 From: "mr. M" Date: Sat, 15 Feb 2025 01:49:22 +0100 Subject: [PATCH 06/31] Enhance tab label handling to support static labels and filter glance tabs during tab movement --- .../tabbrowser/content/tabbrowser-js.patch | 20 ++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/browser/components/tabbrowser/content/tabbrowser-js.patch b/src/browser/components/tabbrowser/content/tabbrowser-js.patch index 43ac69e29..3a56da16a 100644 --- a/src/browser/components/tabbrowser/content/tabbrowser-js.patch +++ b/src/browser/components/tabbrowser/content/tabbrowser-js.patch @@ -1,5 +1,5 @@ diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js -index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f13966d8e2 100644 +index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..8f2cd9ecd708e58a6b162740bb21dafeda43b085 100644 --- a/browser/components/tabbrowser/content/tabbrowser.js +++ b/browser/components/tabbrowser/content/tabbrowser.js @@ -406,11 +406,52 @@ @@ -112,6 +112,15 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f1 // If focus is on the old tab, move it to the new tab. if (activeEl == oldTab) { newTab.focus(); +@@ -1785,7 +1835,7 @@ + } + + _setTabLabel(aTab, aLabel, { beforeTabOpen, isContentTitle, isURL } = {}) { +- if (!aLabel || aLabel.includes("about:reader?")) { ++ if (!aLabel || aLabel.includes("about:reader?") || aTab.hasAttribute("zen-has-static-label")) { + return false; + } + @@ -2387,7 +2437,7 @@ let panel = this.getPanel(browser); @@ -351,6 +360,15 @@ index ff90a70bdad6c94ec4b90027ff102972d0eb28e5..545a6122bc6d6ee55dab7f020cfbe1f1 } if (aTab._tPos == aIndex) { return; +@@ -5717,7 +5825,7 @@ + this._lastRelatedTabMap = new WeakMap(); + + this._handleTabMove(aTab, () => { +- let neighbor = this.tabs[aIndex]; ++ let neighbor = this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[aIndex]; + if (forceStandaloneTab && neighbor.group) { + neighbor = neighbor.group; + } @@ -5727,6 +5835,9 @@ this.tabContainer.insertBefore(aTab, neighbor); } From 62a7e70ebe8055eca35c0ed08cb9b98d6d7b423d Mon Sep 17 00:00:00 2001 From: jso8910 Date: Wed, 5 Feb 2025 23:56:20 +0800 Subject: [PATCH 07/31] Rudimentary tab renaming. Does not persist on page name change or restart --- src/browser/base/content/zen-assets.inc.xhtml | 1 + .../base/content/zen-assets.jar.inc.mn | 1 + .../base/zen-components/ZenTabManager.mjs | 84 +++++++++++++++++++ 3 files changed, 86 insertions(+) create mode 100644 src/browser/base/zen-components/ZenTabManager.mjs diff --git a/src/browser/base/content/zen-assets.inc.xhtml b/src/browser/base/content/zen-assets.inc.xhtml index eefa0a5dd..4ec7bf8f0 100644 --- a/src/browser/base/content/zen-assets.inc.xhtml +++ b/src/browser/base/content/zen-assets.inc.xhtml @@ -33,6 +33,7 @@