Compare commits

..

31 Commits

Author SHA1 Message Date
mr. m
9132019cb3 fix: Fixed unpining split view group still marking a tab as changed, b=(no-bug), c=folders 2025-05-22 20:08:56 +02:00
mr. m
d2c6c8b734 Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2025-05-22 19:59:36 +02:00
mr. m
6c5be98173 feat: Remove default icon from private workspaces, b=(no-bug), c=workspaces 2025-05-22 19:59:14 +02:00
mr. m
a61dd0ab87 Fixed tabs patch
Signed-off-by: mr. m  <91018726+mauro-balades@users.noreply.github.com>
2025-05-22 19:30:11 +02:00
mr. m
d15b1f3c1e Merge branch 'dev' of https://github.com/zen-browser/desktop into dev 2025-05-22 19:17:17 +02:00
mr. m
40d38b3961 feat: Added new private window looks, b=(no-bug), c=common, tabs, workspaces 2025-05-22 19:17:10 +02:00
mr. m
452b7e0e54 Merge pull request #8513 from timothebot/patch-1
fix: Faulty HTML comment hiding whole README
2025-05-22 12:55:06 +02:00
tiimo
e10a16bc0d fix: Faulty HTML comment hiding whole README
Signed-off-by: tiimo <65387160+timothebot@users.noreply.github.com>
2025-05-22 12:31:23 +02:00
mr. m
be55a26a94 feat: Only dispatch elements to the tab browser if we are on the active workspace, b=(no-bug), c=workspaces 2025-05-22 12:13:18 +02:00
mr. m
b03cdba607 fix: Fixed notifications not appearing until hovering the top-bar, b=(closes #8510), c=common 2025-05-22 11:44:33 +02:00
mr. m
cce90e6ddc feat: Initially hide essentials that wont be required on the current workspace, b=(no-bug), c=workspaces 2025-05-22 11:26:19 +02:00
mr. m
b6fc0e4db7 feat: Added support to drag-and-drop split views into glance, b=(no-bug), c=tabs, common, glance, split-view 2025-05-22 11:26:13 +02:00
mr. m
50ed1f0a64 feat: Wait for a new frame before animating workspace backgrounds, b=(no-bug), c=workspaces 2025-05-22 10:23:52 +02:00
mr. m
f40b780b95 fix: Fixed dragging tab to an essential, b=(bug #8465), c=no-component 2025-05-21 15:57:12 +02:00
mr. m
0f37364586 feat: Allow double click only on empty parts of the sidebar, b=(no-bug), c=tabs 2025-05-21 11:48:28 +02:00
mr. m
8cfff0e0bd fix: Added a min size for welcome window, b=(no-bug), c=welcome 2025-05-21 09:19:43 +02:00
mr. m
e61963454c fix: Fixed pressing arrow scroll canceling tab rename, b=(closes #8475), c=common 2025-05-21 09:08:01 +02:00
mr. m
eac698d846 fix: Fixed moving tabs into a glanced tab, b=(bug #8465), c=glance 2025-05-21 08:56:26 +02:00
mr. m
b536f98d94 fix: Fixed initializing workspaces, b=(closes #8476), c=workspaces 2025-05-21 08:31:26 +02:00
Mr. M
469f94bddf fix: Make the appcontent navbar be a flexbox only when needed, b=(no-bug), c=tabs 2025-05-21 06:14:19 +02:00
Mr. M
7af0c64c30 fix: Make the appcontent navbar be a flexbox, b=(no-bug), c=tabs 2025-05-21 06:07:36 +02:00
Mr. M
8e6808ea61 style: Format, b=(no-bug), c=compact-mode 2025-05-20 22:23:22 +02:00
Mr. M
153c0e2fc5 fix: Fixed reordering tabs with glance, b=(bug #8465), c=tabs 2025-05-20 22:21:29 +02:00
Mr. M
b18e946869 feat: Added experimental (unfinished) compact mode animation when hovering, b=(no-bug), c=compact-mode 2025-05-20 22:10:48 +02:00
mr. m
e3a341c88d feat: Transition grain changes, b=(no-bug), c=common 2025-05-20 21:35:35 +02:00
Mr. M
7671266633 feat: Improved gradient switching transitions, b=(no-bug), c=common, workspaces 2025-05-20 21:17:42 +02:00
Mr. M
1e1f02c764 feat: Animate background from numbers, not strings, b=(no-bug), c=workspaces 2025-05-20 19:38:54 +02:00
Mr. M
d3ec41d73f fix: Fixed an issue with top toolbar not able to be hovered, b=(no-bug), c=common, compact-mode, tabs, workspaces 2025-05-20 19:02:44 +02:00
Mr. M
9982b1af34 feat: Better animations for app background, b=(no-bug), c=common, workspaces 2025-05-20 18:05:49 +02:00
Mr. M
133cce8bf8 feat: Prevent rebuilding workspaces when customizing items, b=(no-bug), c=workspaces 2025-05-20 17:27:58 +02:00
Mr. M
bb78fc165b test: Added double click to open tab test, b=(no-bug), c=tabs, workspaces, tests 2025-05-20 17:18:09 +02:00
31 changed files with 511 additions and 232 deletions

View File

@@ -1,3 +1,4 @@
<!-- TODO: Get a job -->
<img src="./docs/assets/zen-dark.svg" width="100px" align="left">
### `Zen Browser`

View File

@@ -1,13 +1,15 @@
diff --git a/browser/base/content/browser-box.inc.xhtml b/browser/base/content/browser-box.inc.xhtml
index 7d7e8697f02f90d4f336c9ab0a73a89848e0c21c..d113b439888d26629ce5f6b5d35f8fa12249774b 100644
index 7d7e8697f02f90d4f336c9ab0a73a89848e0c21c..64e950106dd05b443ce72107613ac9cc405d56ea 100644
--- a/browser/base/content/browser-box.inc.xhtml
+++ b/browser/base/content/browser-box.inc.xhtml
@@ -23,7 +23,13 @@
@@ -23,7 +23,15 @@
<browser id="sidebar" autoscroll="false" disablehistory="true" disablefullscreen="true" tooltip="aHTMLTooltip"/>
</vbox>
<splitter id="sidebar-splitter" class="chromeclass-extrachrome sidebar-splitter" resizebefore="sibling" resizeafter="none" hidden="true"/>
+<vbox flex="1" id="zen-appcontent-wrapper">
+ <html:div id="zen-appcontent-navbar-container"></html:div>
+ <html:div id="zen-appcontent-navbar-wrapper">
+ <html:div id="zen-appcontent-navbar-container"></html:div>
+ </html:div>
+ <hbox id="zen-tabbox-wrapper" flex="1">
<tabbox id="tabbrowser-tabbox" flex="1" tabcontainer="tabbrowser-tabs">
+#include zen-tabbrowser-elements.inc.xhtml

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237adbec83dd 100644
index 6dece2b9d0462d90a28e75350ce983d87816ef73..5c49c43714b3914130f8d821d902f9f255c4ebc9 100644
--- a/browser/components/tabbrowser/content/tabbrowser.js
+++ b/browser/components/tabbrowser/content/tabbrowser.js
@@ -415,11 +415,45 @@
@@ -579,7 +579,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
aTab.selected ||
aTab.closing ||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
@@ -6002,7 +6135,7 @@
@@ -6001,7 +6134,7 @@
// Don't allow mixing pinned and unpinned tabs.
if (this.isTab(element) && element.pinned) {
@@ -588,11 +588,13 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
} else {
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
}
@@ -6029,9 +6162,15 @@
@@ -6027,10 +6160,16 @@
this.#handleTabMove(
element,
() => {
let neighbor = this.tabs[tabIndex];
- let neighbor = this.tabs[tabIndex];
- if (forceUngrouped && neighbor.group) {
+ let neighbor = gZenGlanceManager.getTabOrGlanceParent(this.tabs.filter(tab => !tab.hasAttribute("zen-glance-tab"))[tabIndex]);
+ if ((forceUngrouped && neighbor?.group) || neighbor?.group?.hasAttribute("split-view-group")) {
neighbor = neighbor.group;
}
@@ -605,7 +607,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
neighbor.after(element);
} else {
@@ -6100,7 +6239,9 @@
@@ -6099,7 +6238,9 @@
targetElement = targetElement.group;
}
}
@@ -616,13 +618,14 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
// Don't allow mixing pinned and unpinned tabs.
if (element.pinned && !targetElement?.pinned) {
targetElement = this.tabs[this.pinnedTabCount - 1];
@@ -6110,7 +6251,13 @@
@@ -6109,7 +6250,14 @@
moveBefore = true;
}
+ if (targetElement?.group?.hasAttribute("split-view-group")) {
+ targetElement = targetElement.group;
+ }
+ targetElement = gZenGlanceManager.getTabOrGlanceParent(targetElement);
let getContainer = () => {
+ if (element.hasAttribute("zen-essential")) {
+ return gZenWorkspaces.getEssentialsSection(element);
@@ -630,7 +633,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
if (element.pinned && this.tabContainer.verticalMode) {
return this.tabContainer.verticalPinnedTabsContainer;
}
@@ -6170,7 +6317,7 @@
@@ -6169,7 +6317,7 @@
if (!this.isTab(aTab)) {
throw new Error("Can only move a tab into a tab group");
}
@@ -639,7 +642,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
return;
}
if (aTab.group && aTab.group.id === aGroup.id) {
@@ -6264,6 +6411,10 @@
@@ -6263,6 +6411,10 @@
moveActionCallback();
@@ -650,7 +653,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
// Clear tabs cache after moving nodes because the order of tabs may have
// changed.
this.tabContainer._invalidateCachedTabs();
@@ -7081,7 +7232,7 @@
@@ -7080,7 +7232,7 @@
// preventDefault(). It will still raise the window if appropriate.
break;
}
@@ -659,7 +662,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
window.focus();
aEvent.preventDefault();
break;
@@ -7982,6 +8133,7 @@
@@ -7981,6 +8133,7 @@
aWebProgress.isTopLevel
) {
this.mTab.setAttribute("busy", "true");
@@ -667,7 +670,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
gBrowser._tabAttrModified(this.mTab, ["busy"]);
this.mTab._notselectedsinceload = !this.mTab.selected;
}
@@ -8955,7 +9107,7 @@ var TabContextMenu = {
@@ -8954,7 +9107,7 @@ var TabContextMenu = {
);
contextUnpinSelectedTabs.hidden =
!this.contextTab.pinned || !this.multiselected;
@@ -676,7 +679,7 @@ index dacf52070348a205a56ef42eb8320602f98e5daa..b5c05dfba338b1252b23d2d47336237a
// Move Tab items
let contextMoveTabOptions = document.getElementById(
"context_moveTabOptions"
@@ -9224,6 +9376,7 @@ var TabContextMenu = {
@@ -9223,6 +9376,7 @@ var TabContextMenu = {
telemetrySource: gBrowser.TabMetrics.METRIC_SOURCE.TAB_STRIP,
});
} else {

View File

@@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabs.js b/browser/components/tabbrowser/content/tabs.js
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42083789d5 100644
index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..b413b4bc9d86726b0f8936a3422636ed3ca882e1 100644
--- a/browser/components/tabbrowser/content/tabs.js
+++ b/browser/components/tabbrowser/content/tabs.js
@@ -83,7 +83,7 @@
@@ -24,7 +24,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
if (
event.button != 0 ||
- event.target != this.arrowScrollbox ||
+ event.target != document.getElementById("zen-tabs-wrapper") ||
+ !event.target.classList.contains("zen-workspace-normal-tabs-section") ||
event.composedTarget.localName == "toolbarbutton"
) {
return;
@@ -136,7 +136,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
get verticalMode() {
@@ -1606,29 +1636,53 @@
@@ -1606,29 +1636,55 @@
if (this.#allTabs) {
return this.#allTabs;
}
@@ -173,19 +173,21 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
...children,
];
+ const lastPinnedTabIdx = pinnedTabs.length - 1;
+ for (let i = 0; i < allTabs.length; i++) {
+ let i = 0;
+ for (const tab of [...allTabs]) {
+ // add glance tabs (tabs inside tabs) to the list
+ const glanceTab = allTabs[i].glanceTab;
+ const glanceTab = tab.glanceTab;
+ if (glanceTab) {
+ // insert right after the parent tab. note: it must be inserted before
+ // the last pinned tab so it can be inserted in the correct order
+ allTabs.splice(Math.max(i + 1, lastPinnedTabIdx), 0, glanceTab);
+ i++;
+ } else if (allTabs[i].classList.contains("vertical-pinned-tabs-container-separator")) {
+ } else if (tab.classList.contains("vertical-pinned-tabs-container-separator")) {
+ // remove the separator from the list
+ allTabs.splice(i, 1);
+ i--;
+ }
+ i++;
+ }
+ this.#allTabs = allTabs;
return this.#allTabs;
@@ -198,7 +200,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
/**
@@ -1648,7 +1702,7 @@
@@ -1648,7 +1704,7 @@
*/
get visibleTabs() {
if (!this.#visibleTabs) {
@@ -207,7 +209,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
return this.#visibleTabs;
}
@@ -1683,36 +1737,40 @@
@@ -1683,36 +1739,40 @@
}
let elementIndex = 0;
@@ -261,7 +263,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
return this.#focusableItems;
}
@@ -1720,6 +1778,7 @@
@@ -1720,6 +1780,7 @@
_invalidateCachedTabs() {
this.#allTabs = null;
this._invalidateCachedVisibleTabs();
@@ -269,7 +271,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
_invalidateCachedVisibleTabs() {
@@ -1734,8 +1793,8 @@
@@ -1734,8 +1795,8 @@
#isContainerVerticalPinnedGrid(tab) {
return (
this.verticalMode &&
@@ -280,7 +282,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
!this.expandOnHover
);
}
@@ -1751,7 +1810,7 @@
@@ -1751,7 +1812,7 @@
if (node == null) {
// We have a container for non-tab elements at the end of the scrollbox.
@@ -289,7 +291,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
node.before(tab);
@@ -1846,7 +1905,7 @@
@@ -1846,7 +1907,7 @@
// There are separate "new tab" buttons for horizontal tabs toolbar, vertical tabs and
// for when the tab strip is overflowed (which is shared by vertical and horizontal tabs);
// Attach the long click popup to all of them.
@@ -298,7 +300,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
const newTab2 = this.newTabButton;
const newTabVertical = document.getElementById(
"vertical-tabs-newtab-button"
@@ -1941,10 +2000,12 @@
@@ -1941,10 +2002,12 @@
_handleTabSelect(aInstant) {
let selectedTab = this.selectedItem;
@@ -311,7 +313,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
selectedTab._notselectedsinceload = false;
}
@@ -2085,16 +2146,15 @@
@@ -2085,16 +2148,15 @@
// Move pinned tabs to another container when the tabstrip is toggled to vertical
// and when session restore code calls _positionPinnedTabs; update styling whenever
// the number of pinned tabs changes.
@@ -334,7 +336,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
}
@@ -2102,9 +2162,7 @@
@@ -2102,9 +2164,7 @@
}
_resetVerticalPinnedTabs() {
@@ -345,7 +347,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
if (!verticalTabsContainer.children.length) {
return;
@@ -2117,7 +2175,7 @@
@@ -2117,7 +2177,7 @@
}
_positionPinnedTabs() {
@@ -354,7 +356,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let numPinned = gBrowser.pinnedTabCount;
let absPositionHorizontalTabs =
this.overflowing && tabs.length > numPinned && numPinned > 0;
@@ -2127,7 +2185,7 @@
@@ -2127,7 +2187,7 @@
if (this.verticalMode) {
this._updateVerticalPinnedTabs();
@@ -363,7 +365,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let layoutData = this._pinnedTabsLayoutCache;
let uiDensity = document.documentElement.getAttribute("uidensity");
if (!layoutData || layoutData.uiDensity != uiDensity) {
@@ -2191,7 +2249,7 @@
@@ -2191,7 +2251,7 @@
return;
}
@@ -372,7 +374,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let directionX = screenX > dragData.animLastScreenX;
let directionY = screenY > dragData.animLastScreenY;
@@ -2199,7 +2257,7 @@
@@ -2199,7 +2259,7 @@
dragData.animLastScreenX = screenX;
let { width: tabWidth, height: tabHeight } =
@@ -381,7 +383,16 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let shiftSizeX = tabWidth * movingTabs.length;
let shiftSizeY = tabHeight;
dragData.tabWidth = tabWidth;
@@ -2374,12 +2432,16 @@
@@ -2262,7 +2322,7 @@
// * We're doing a binary search in order to reduce the amount of
// tabs we need to check.
- tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab);
+ tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab && !t.hasAttribute("zen-glance-tab"));
let firstTabCenterX = firstMovingTabScreenX + translateX + tabWidth / 2;
let lastTabCenterX = lastMovingTabScreenX + translateX + tabWidth / 2;
let tabCenterX = directionX ? lastTabCenterX : firstTabCenterX;
@@ -2374,12 +2434,16 @@
this.#clearDragOverCreateGroupTimer();
@@ -403,7 +414,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
if (this.#rtlMode) {
tabs.reverse();
@@ -2393,7 +2455,7 @@
@@ -2393,7 +2457,7 @@
let size = this.verticalMode ? "height" : "width";
let translateAxis = this.verticalMode ? "translateY" : "translateX";
let scrollDirection = this.verticalMode ? "scrollTop" : "scrollLeft";
@@ -412,7 +423,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let translateX = event.screenX - dragData.screenX;
let translateY = event.screenY - dragData.screenY;
@@ -2407,12 +2469,21 @@
@@ -2407,12 +2471,21 @@
let lastTab = tabs.at(-1);
let lastMovingTab = movingTabs.at(-1);
let firstMovingTab = movingTabs[0];
@@ -435,7 +446,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
translate +=
this.arrowScrollbox.scrollbox[scrollDirection] - dragData.scrollPos;
} else if (isPinned && this.verticalMode) {
@@ -2431,6 +2502,9 @@
@@ -2431,12 +2504,15 @@
// Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement;
}
@@ -445,7 +456,14 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
item.style.transform = `${translateAxis}(${translate}px)`;
}
@@ -2568,6 +2642,9 @@
dragData.translatePos = translate;
- tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab);
+ tabs = tabs.filter(t => !movingTabs.includes(t) || t == draggedTab && !t.hasAttribute("zen-glance-tab"));
/**
* When the `draggedTab` is just starting to move, the `draggedTab` is in
@@ -2568,6 +2644,9 @@
break;
}
let element = tabs[mid];
@@ -455,18 +473,20 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
let elementForSize = isTabGroupLabel(element)
? element.parentElement
: element;
@@ -2590,6 +2667,10 @@
@@ -2588,7 +2667,11 @@
let dropElement = getOverlappedElement();
if (!dropElement) {
dropElement = this.ariaFocusableItems[oldDropElementIndex];
}
- dropElement = this.ariaFocusableItems[oldDropElementIndex];
+ dropElement = this.ariaFocusableItems.filter(tab => !tab.hasAttribute("zen-glance-tab"))[oldDropElementIndex];
+ }
+ if (dropElement?.group?.hasAttribute("split-view-group")) {
+ // We focus the group label element, not the group itself.
+ dropElement = dropElement.group.labelElement;
+ }
}
let newDropElementIndex = dropElement
? dropElement.elementIndex
: oldDropElementIndex;
@@ -2598,7 +2679,7 @@
@@ -2598,7 +2681,7 @@
let shouldCreateGroupOnDrop;
let dropBefore;
if (dropElement) {
@@ -475,7 +495,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
? dropElement.parentElement
: dropElement;
@@ -2660,12 +2741,12 @@
@@ -2660,12 +2743,12 @@
}
}
@@ -490,7 +510,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
dropElement != draggedTab &&
isTab(dropElement) &&
!dropElement?.group &&
@@ -2735,7 +2816,7 @@
@@ -2735,7 +2818,7 @@
// Shift background tabs to leave a gap where the dragged tab
// would currently be dropped.
for (let item of tabs) {
@@ -499,7 +519,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
continue;
}
@@ -2744,6 +2825,9 @@
@@ -2744,6 +2827,9 @@
if (isTabGroupLabel(item)) {
// Shift the `.tab-group-label-container` to shift the label element.
item = item.parentElement;
@@ -509,7 +529,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
}
item.style.transform = transform;
}
@@ -2796,8 +2880,9 @@
@@ -2796,8 +2882,9 @@
);
}
@@ -521,7 +541,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
return;
}
@@ -2809,6 +2894,12 @@
@@ -2809,6 +2896,12 @@
item = item.parentElement;
}
item.style.transform = "";
@@ -534,7 +554,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
item.removeAttribute("dragover-createGroup");
}
this.removeAttribute("movingtab-createGroup");
@@ -2855,7 +2946,7 @@
@@ -2855,7 +2948,7 @@
let postTransitionCleanup = () => {
movingTab._moveTogetherSelectedTabsData.animate = false;
};
@@ -543,7 +563,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
postTransitionCleanup();
} else {
let onTransitionEnd = transitionendEvent => {
@@ -3028,7 +3119,7 @@
@@ -3028,7 +3121,7 @@
}
_notifyBackgroundTab(aTab) {
@@ -552,7 +572,7 @@ index ef9c0389ec926e6bc01c0dc3b883beceaf1f7d43..f7b8ce70fc77d5e00cc066f203609a42
return;
}
@@ -3154,6 +3245,9 @@
@@ -3154,6 +3247,9 @@
return null;
}
}

View File

@@ -1,20 +1,18 @@
diff --git a/browser/themes/linux/browser.css b/browser/themes/linux/browser.css
index 5c9891e5ed4b865ed4ecc98d794a239b0f96a8f9..e13bf7277edeb49ebbb12cf9359ac6193bb47ebd 100644
index 5c9891e5ed4b865ed4ecc98d794a239b0f96a8f9..53e69289620dd7e89dad167fb3a59b162545dd89 100644
--- a/browser/themes/linux/browser.css
+++ b/browser/themes/linux/browser.css
@@ -42,21 +42,25 @@
@@ -42,7 +42,8 @@
-moz-default-appearance: -moz-window-decorations;
appearance: auto;
- #navigator-toolbox,
- dialog::backdrop {
+ #zen-main-app-wrapper,
+ dialog::backdrop,
+ #browser::after,
+ #browser::before {
+ #zen-browser-background,
dialog::backdrop {
border-top-left-radius: env(-moz-gtk-csd-titlebar-radius);
border-top-right-radius: env(-moz-gtk-csd-titlebar-radius);
}
@@ -50,13 +51,14 @@
/* stylelint-disable-next-line media-query-no-invalid */
@media -moz-pref("widget.gtk.rounded-bottom-corners.enabled") {
@@ -27,8 +25,7 @@ index 5c9891e5ed4b865ed4ecc98d794a239b0f96a8f9..e13bf7277edeb49ebbb12cf9359ac619
body,
- dialog::backdrop {
+ dialog::backdrop,
+ #browser::after,
+ #browser::before {
+ #zen-browser-background {
/* Use an uniform clip to allow WebRender to optimize it better */
border-radius: env(-moz-gtk-csd-titlebar-radius);
}

View File

@@ -1,5 +1,5 @@
diff --git a/toolkit/content/widgets/tabbox.js b/toolkit/content/widgets/tabbox.js
index 6775a7635c6cdbb276b3a912d0bba07840acb28f..4ef3eb6a7dbd741cf432668c2ff6e832f5bb97e7 100644
index 6775a7635c6cdbb276b3a912d0bba07840acb28f..861640d12c6118e11acb3f51723a79098dbbba10 100644
--- a/toolkit/content/widgets/tabbox.js
+++ b/toolkit/content/widgets/tabbox.js
@@ -213,7 +213,7 @@
@@ -7,7 +7,7 @@ index 6775a7635c6cdbb276b3a912d0bba07840acb28f..4ef3eb6a7dbd741cf432668c2ff6e832
this._inAsyncOperation = false;
if (oldPanel != this._selectedPanel) {
- oldPanel?.classList.remove("deck-selected");
+ if (!oldPanel?.classList.contains("zen-glance-background")) oldPanel?.classList.remove("deck-selected");
+ if (!(window.gZenGlanceManager && gZenGlanceManager.shouldShowDeckSelected(this._selectedPanel, oldPanel))) oldPanel?.classList.remove("deck-selected");
this._selectedPanel?.classList.add("deck-selected");
}
this.setAttribute("selectedIndex", val);

View File

@@ -2,11 +2,21 @@
var ZenStartup = {
init() {
this.openWatermark();
this._initBrowserBackground();
this._changeSidebarLocation();
this._zenInitBrowserLayout();
this._initSearchBar();
},
_initBrowserBackground() {
const background = document.createXULElement('box');
background.id = 'zen-browser-background';
const grain = document.createXULElement('box');
grain.id = 'zen-browser-grain';
background.appendChild(grain);
document.getElementById('browser').prepend(background);
},
_zenInitBrowserLayout() {
if (this.__hasInitBrowserLayout) return;
this.__hasInitBrowserLayout = true;
@@ -25,7 +35,7 @@
// Fix notification deck
const deckTemplate = document.getElementById('tab-notification-deck-template');
if (deckTemplate) {
document.getElementById('zen-appcontent-navbar-container').appendChild(deckTemplate);
document.getElementById('zen-appcontent-wrapper').prepend(deckTemplate);
}
this._hideUnusedElements();

View File

@@ -798,6 +798,7 @@ var gZenVerticalTabsManager = {
}
const appContentNavbarContaienr = document.getElementById('zen-appcontent-navbar-container');
const appContentNavbarWrapper = document.getElementById('zen-appcontent-navbar-wrapper');
let shouldHide = false;
if (
((!isRightSide && this.isWindowsStyledButtons) ||
@@ -805,10 +806,10 @@ var gZenVerticalTabsManager = {
(isCompactMode && isSingleToolbar && this.isWindowsStyledButtons)) &&
isSingleToolbar
) {
appContentNavbarContaienr.setAttribute('should-hide', 'true');
appContentNavbarWrapper.setAttribute('should-hide', 'true');
shouldHide = true;
} else {
appContentNavbarContaienr.removeAttribute('should-hide');
appContentNavbarWrapper.removeAttribute('should-hide');
}
// Check if the sidebar is in hover mode
@@ -986,6 +987,7 @@ var gZenVerticalTabsManager = {
},
async renameTabKeydown(event) {
event.stopPropagation();
if (event.key === 'Enter') {
let label = this._tabEdited.querySelector('.tab-label-container-editing');
let input = this._tabEdited.querySelector('#tab-label-input');

View File

@@ -62,15 +62,6 @@
}
}
@keyframes zen-main-app-wrapper-animation {
from {
opacity: 1;
}
to {
opacity: 0;
}
}
@keyframes zen-jello-out-animation {
0% {
transform: scale3d(1, 1, 1);

View File

@@ -10,13 +10,15 @@
position: relative;
overflow: hidden;
:root:not([zen-no-padding='true']) & {
border-radius: var(--zen-native-inner-radius);
box-shadow: var(--zen-big-shadow);
}
&.browserSidebarContainer {
:root:not([zen-no-padding='true']) & {
border-radius: var(--zen-native-inner-radius);
box-shadow: var(--zen-big-shadow);
}
& browser[transparent='true'] {
background: rgba(255, 255, 255, 0.1);
& browser[transparent='true'] {
background: rgba(255, 255, 255, 0.1);
}
}
}

View File

@@ -32,57 +32,72 @@
}
#browser {
background: transparent !important;
width: 100%;
background: var(--zen-main-browser-background) !important;
}
will-change: background-color;
#zen-browser-background {
width: 100%;
height: 100%;
position: absolute;
top: 0;
left: 0;
z-index: 0;
pointer-events: none;
&::after {
isolation: isolate;
&::after,
&::before {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
position: absolute;
inset: 0;
z-index: 0;
pointer-events: none;
}
&:not([post-animating='true'])::after {
transition: background-color var(--inactive-window-transition);
}
@media -moz-pref('zen.theme.gradient') {
&[animating='true']::after {
background: var(--zen-main-browser-background-old);
backdrop-filter: blur(5px);
animation: zen-main-app-wrapper-animation 0.4s ease forwards;
&::after {
background: var(--zen-main-browser-background);
opacity: var(--zen-background-opacity);
transition: 0s;
}
&::before {
background: var(--zen-main-browser-background-old);
opacity: calc(1 - var(--zen-background-opacity));
transition: 0s;
}
:root[animating-background='true'] &::after {
mix-blend-mode: normal;
}
}
:root:not([animating-background='true']) &::before {
transition: background-color var(--inactive-window-transition);
}
@media (not (-moz-windows-mica)) and -moz-pref('zen.view.grey-out-inactive-windows') {
transition: color var(--inactive-window-transition);
:root:not([zen-welcome-stage]) &:-moz-window-inactive {
color: var(--toolbox-textcolor-inactive);
&::after {
&::before {
background-color: var(--toolbox-bgcolor-inactive);
}
}
}
&::before {
#zen-browser-grain {
content: '';
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
width: 100%;
height: 100%;
background-image: url(chrome://browser/content/zen-images/grain-bg.png);
pointer-events: none;
z-index: 0;
opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay;
transition: opacity 0.3s ease-in-out;
}
}

View File

@@ -19,6 +19,8 @@
--zen-border-radius: 7px;
--zen-primary-color: #ffb787;
--zen-background-opacity: 1;
/* Branding */
--zen-branding-dark: #1d1d1d;
--zen-branding-coral: #f76f53;
@@ -197,6 +199,16 @@
--zen-themed-toolbar-bg-transparent: transparent;
}
&[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-toolbar: var(--zen-main-browser-background);
--zen-primary-color: light-dark(rgb(93, 42, 107), rgb(110, 48, 125)) !important;
}
--toolbar-field-background-color: var(--zen-colors-input-bg) !important;
--arrowpanel-background: var(--zen-dialog-background) !important;

View File

@@ -8,6 +8,6 @@
background: transparent;
}
:root[inDOMFullscreen='true'] #zen-appcontent-navbar-container {
:root[inDOMFullscreen='true'] #zen-appcontent-navbar-wrapper {
visibility: collapse;
}

View File

@@ -51,7 +51,7 @@ var gZenCompactModeManager = {
gZenUIManager.addPopupTrackingAttribute(this.sidebar);
gZenUIManager.addPopupTrackingAttribute(
document.getElementById('zen-appcontent-navbar-container')
document.getElementById('zen-appcontent-navbar-wrapper')
);
// Clear hover states when window state changes (minimize, maximize, etc.)
@@ -260,6 +260,7 @@ var gZenCompactModeManager = {
this.sidebar.style.removeProperty('transform');
window.requestAnimationFrame(() => {
let sidebarWidth = this.getAndApplySidebarWidth();
const elementSeparation = ZenThemeModifier.elementSeparation;
if (!canAnimate) {
this.sidebar.removeAttribute('animate');
document.documentElement.removeAttribute('zen-compact-animating');
@@ -267,11 +268,44 @@ var gZenCompactModeManager = {
this.getAndApplySidebarWidth({});
this._ignoreNextResize = true;
// TODO: Work on this a bit more, needs polishing
if (lazyCompactMode.COMPACT_MODE_CAN_ANIMATE_SIDEBAR && false) {
gZenUIManager.motion
.animate(
[
this.sidebar,
...(gZenVerticalTabsManager._hasSetSingleToolbar &&
!gURLBar.hasAttribute('zen-floating-urlbar')
? [gURLBar.textbox]
: []),
],
{
transform: [
`translateY(${((isCompactMode ? -1 : 1) * elementSeparation) / 2}px) translateX(${
isCompactMode
? (this.sidebarIsOnRight ? elementSeparation : -elementSeparation) / 2
: (this.sidebarIsOnRight ? -elementSeparation : elementSeparation) / 2
}px)`,
`translateY(0px) translateX(0px)`,
],
},
{
ease: 'easeIn',
type: 'spring',
bounce: 0,
duration: 0.2,
}
)
.then(() => {
this.sidebar.style.transform = '';
gURLBar.textbox.style.transform = '';
});
}
resolve();
return;
}
if (canHideSidebar && isCompactMode) {
const elementSeparation = ZenThemeModifier.elementSeparation;
if (document.documentElement.hasAttribute('zen-sidebar-expanded')) {
sidebarWidth -= 0.5 * splitterWidth;
if (elementSeparation < splitterWidth) {
@@ -428,7 +462,7 @@ var gZenCompactModeManager = {
keepHoverDuration: 100,
},
{
element: document.getElementById('zen-appcontent-navbar-container'),
element: document.getElementById('zen-appcontent-navbar-wrapper'),
screenEdge: 'top',
},
]),
@@ -608,7 +642,7 @@ var gZenCompactModeManager = {
},
toggleToolbar() {
let toolbar = document.getElementById('zen-appcontent-navbar-container');
let toolbar = document.getElementById('zen-appcontent-navbar-wrapper');
toolbar.toggleAttribute('zen-user-show');
},

View File

@@ -38,11 +38,11 @@
padding-inline-start: calc(var(--zen-toolbox-padding) - var(--toolbarbutton-outer-padding)) !important;
}
&:not([zen-window-buttons-reversed='true']) #zen-appcontent-navbar-container #nav-bar {
&:not([zen-window-buttons-reversed='true']) #zen-appcontent-navbar-wrapper #nav-bar {
margin-left: var(--zen-element-separation) !important;
}
&[zen-window-buttons-reversed='true'] #zen-appcontent-navbar-container #nav-bar {
&[zen-window-buttons-reversed='true'] #zen-appcontent-navbar-wrapper #nav-bar {
margin-right: var(--zen-element-separation) !important;
margin-left: calc(var(--zen-element-separation) - 3px) !important;
}
@@ -172,6 +172,7 @@
z-index: 0;
opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay;
transition: opacity 0.3s ease-in-out;
}
}
@@ -340,68 +341,77 @@
margin-top: calc(var(--zen-element-separation) * 2) !important;
}
& #zen-appcontent-navbar-container {
& #zen-appcontent-navbar-wrapper {
--zen-compact-toolbar-offset: 5px;
position: absolute;
top: calc((-1 * var(--zen-toolbar-height)) + var(--zen-element-separation) + 1px);
top: calc(-1 * var(--zen-toolbar-height) + 1px);
left: 0;
z-index: 20;
box-shadow: 0 0 1px 1px rgba(0, 0, 0, 0.3) !important;
border-bottom-left-radius: var(--zen-border-radius);
border-bottom-right-radius: var(--zen-border-radius);
border-top-left-radius: env(-moz-gtk-csd-titlebar-radius);
border-top-right-radius: env(-moz-gtk-csd-titlebar-radius);
transition: all 0.15s ease;
width: 100%;
visibility: hidden;
background: var(--zen-dialog-background);
max-height: var(--zen-toolbar-height);
overflow: hidden;
& > * {
position: relative !important;
}
& #urlbar:not([breakout-extend='true']) {
opacity: 0 !important;
}
@media -moz-pref('zen.view.compact.color-toolbar') {
background-attachment: fixed;
background: var(--zen-main-browser-background-toolbar);
background-size: 100% 2000px;
border-bottom: 1px solid var(--zen-colors-border);
& #zen-appcontent-navbar-container {
visibility: hidden;
box-shadow: var(--zen-big-shadow);
border-bottom-left-radius: var(--zen-border-radius);
border-bottom-right-radius: var(--zen-border-radius);
:root:not([sizemode='maximized']) & {
border-top-left-radius: env(-moz-gtk-csd-titlebar-radius);
border-top-right-radius: env(-moz-gtk-csd-titlebar-radius);
}
transition: all 0.15s ease;
width: 100%;
background: var(--zen-dialog-background);
& > * {
position: relative !important;
}
@media -moz-pref('zen.view.compact.color-toolbar') {
background-attachment: fixed;
background: var(--zen-main-browser-background-toolbar);
background-size: 100% 2000px;
}
}
}
& #zen-appcontent-navbar-container[zen-has-hover]:not(:has(#urlbar[zen-floating-urlbar='true']:hover)),
& #zen-appcontent-navbar-container[zen-user-show],
& #zen-appcontent-navbar-container[has-popup-menu],
& #zen-appcontent-navbar-container:has(
& #zen-appcontent-navbar-wrapper[zen-has-hover]:not(:has(#urlbar[zen-floating-urlbar='true']:hover)),
& #zen-appcontent-navbar-wrapper[zen-user-show],
& #zen-appcontent-navbar-wrapper[has-popup-menu],
& #zen-appcontent-navbar-wrapper:has(
*:is([panelopen='true'], [open='true'], #urlbar:focus-within, [breakout-extend='true']):not(#urlbar[zen-floating-urlbar='true']):not(.zen-compact-mode-ignore)
) {
visibility: visible !important;
& #zen-appcontent-navbar-container {
visibility: visible !important;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url(chrome://browser/content/zen-images/grain-bg.png);
pointer-events: none;
z-index: 0;
opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay;
transition: opacity 0.3s ease-in-out;
}
}
border-top-width: 1px;
top: -1px;
overflow: initial;
max-height: unset;
&::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background-image: url(chrome://browser/content/zen-images/grain-bg.png);
pointer-events: none;
z-index: 0;
opacity: var(--zen-grainy-background-opacity, 0);
mix-blend-mode: overlay;
}
& #urlbar {
opacity: 1 !important;
}
@@ -426,7 +436,7 @@
}
@media -moz-pref('zen.view.compact.hide-toolbar') {
&:not([zen-single-toolbar='true']) {
& #zen-appcontent-navbar-container {
& #zen-appcontent-navbar-wrapper {
opacity: 0;
}
}

View File

@@ -81,6 +81,7 @@
if (group.hasAttribute('split-view-group') && !this._piningFolder) {
this._piningFolder = true;
for (const otherTab of group.tabs) {
gZenPinnedTabManager.resetPinChangedUrl(otherTab);
if (tab === otherTab) {
continue;
}

View File

@@ -712,7 +712,7 @@
}
getTabOrGlanceParent(tab) {
if (tab.hasAttribute('glance-id')) {
if (tab?.hasAttribute('glance-id')) {
const parentTab = this.#glances.get(tab.getAttribute('glance-id')).parentTab;
if (parentTab) {
return parentTab;
@@ -720,6 +720,27 @@
}
return tab;
}
shouldShowDeckSelected(currentPanel, oldPanel) {
// Dont remove if it's a glance background and current panel corresponds to a glance
const currentBrowser = currentPanel?.querySelector('browser');
const oldBrowser = oldPanel?.querySelector('browser');
if (!currentBrowser || !oldBrowser) {
return false;
}
const currentTab = gBrowser.getTabForBrowser(currentBrowser);
const oldTab = gBrowser.getTabForBrowser(oldBrowser);
if (currentTab && oldTab) {
const currentGlanceID = currentTab.getAttribute('glance-id');
const oldGlanceID = oldTab.getAttribute('glance-id');
if (currentGlanceID && oldGlanceID) {
return (
currentGlanceID === oldGlanceID && oldPanel.classList.contains('zen-glance-background')
);
}
}
return false;
}
}
window.gZenGlanceManager = new ZenGlanceManager();

View File

@@ -335,6 +335,10 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
]);
if (this._finishAllAnimatingPromise) {
this._finishAllAnimatingPromise.then(() => {
draggedTab.linkedBrowser.docShellIsActive = false;
draggedTab.linkedBrowser
.closest('.browserSidebarContainer')
.classList.remove('deck-selected');
this.fakeBrowser.addEventListener('dragleave', this.onBrowserDragEndToSplit);
this._canDrop = true;
draggedTab._visuallySelected = true;
@@ -1630,7 +1634,9 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
: containerRect.left - padding - 5,
event.clientY
);
const browser = dropTarget?.closest('browser');
const browser =
dropTarget?.closest('browser') ??
dropTarget?.closest('.browserSidebarContainer')?.querySelector('browser');
if (!browser) {
this._maybeRemoveFakeBrowser(false);
@@ -1644,7 +1650,7 @@ class ZenViewSplitter extends ZenDOMOperatedFeature {
browserContainer.style.opacity = '0';
}
const droppedOnTab = gBrowser.getTabForBrowser(browser);
const droppedOnTab = gZenGlanceManager.getTabOrGlanceParent(gBrowser.getTabForBrowser(browser));
if (droppedOnTab && droppedOnTab !== draggedTab) {
// Calculate which side of the target browser the drop occurred
// const browserRect = browser.getBoundingClientRect();

View File

@@ -151,7 +151,7 @@
document.documentElement.getAttribute('chromehidden')?.includes('menubar')
);
}
return this._enabled;
return this._enabled && !gZenWorkspaces.privateWindowOrDisabled;
}
async _refreshPinnedTabs({ init = false } = {}) {
@@ -752,6 +752,9 @@
}
_insertItemsIntoTabContextMenu() {
if (!this.enabled) {
return;
}
const elements = window.MozXULElement.parseXULToFragment(`
<menuseparator id="context_zen-pinned-tab-separator" hidden="true"/>
<menuitem id="context_zen-replace-pinned-url-with-current"
@@ -794,6 +797,7 @@
updatePinnedTabContextMenu(contextTab) {
if (!this.enabled) {
document.getElementById('context_pinTab').hidden = true;
return;
}
const isVisible = contextTab.pinned && !contextTab.multiselected;
@@ -816,6 +820,9 @@
}
moveToAnotherTabContainerIfNecessary(event, movingTabs) {
if (!this.enabled) {
return false;
}
try {
const pinnedTabsTarget =
event.target.closest('.zen-workspace-pinned-tabs-section') ||
@@ -1014,6 +1021,9 @@
}
applyDragoverClass(event, draggedTab) {
if (!this.enabled) {
return;
}
const pinnedTabsTarget = event.target.closest('.zen-workspace-pinned-tabs-section');
const essentialTabsTarget = event.target.closest('.zen-essentials-container');
const tabsTarget = event.target.closest('.zen-workspace-normal-tabs-section');

View File

@@ -21,7 +21,7 @@
Single Toolbar Mode - Top Bar Handling (Includes External CSS)
========================================================================== */
:root[zen-single-toolbar='true']:not([customizing]) {
#zen-appcontent-navbar-container {
#zen-appcontent-navbar-wrapper {
display: flex;
-moz-window-dragging: drag; /* Allow dragging the window via this bar */
min-height: var(--zen-element-separation);

View File

@@ -1,6 +1,10 @@
height: var(--zen-toolbar-height);
z-index: 1;
#zen-appcontent-navbar-container {
display: flex;
}
@media -moz-pref('zen.view.hide-window-controls') {
& {
transition:

View File

@@ -17,12 +17,16 @@
height: 100%; /* Make sure they take up full height */
}
#zen-appcontent-navbar-container {
width: 100%;
}
/* ==========================================================================
Single Toolbar Mode Specific Styles (`zen-single-toolbar='true'`)
========================================================================== */
:root[zen-single-toolbar='true'] {
/* Define and apply a smaller toolbar height for single toolbar mode */
& #zen-appcontent-navbar-container,
& #zen-appcontent-navbar-wrapper,
& #zen-sidebar-top-buttons {
--zen-toolbar-height: 32px;
height: var(--zen-toolbar-height);
@@ -1475,12 +1479,3 @@
width: 100%;
}
}
/* ==========================================================================
Section: Workspaces disabled, due to private browsing mode
========================================================================== */
:root:not([zen-workspace-id]) #tabbrowser-arrowscrollbox {
width: 100%;
position: absolute;
}

View File

@@ -5,3 +5,4 @@ support-files = [
["browser_basic_workspaces.js"]
["browser_workspace_bookmarks.js"]
["browser_double_click_newtab.js"]

View File

@@ -0,0 +1,14 @@
/* Any copyright is dedicated to the Public Domain.
https://creativecommons.org/publicdomain/zero/1.0/ */
'use strict';
add_task(async function test_Check_Creation() {
const placeToDoubleClick = gZenWorkspaces.activeWorkspaceStrip;
EventUtils.sendMouseEvent({ type: 'dblclick' }, placeToDoubleClick, window);
await TestUtils.waitForCondition(() => gBrowser.tabs.length === 3, 'New tab should be opened.');
ok(true, 'New tab should be opened.');
await BrowserTestUtils.removeTab(gBrowser.tabs[2]);
ok(gBrowser.tabs.length === 2, 'There should be one tab.');
});

View File

@@ -15,8 +15,13 @@
-moz-window-dragging: drag;
}
:root[zen-welcome-stage] #zen-sidebar-splitter {
display: none;
:root[zen-welcome-stage] {
min-width: 875px;
min-height: 560px;
#zen-sidebar-splitter {
display: none;
}
}
#zen-welcome-start {
@@ -30,6 +35,7 @@
list-style-image: url(chrome://browser/skin/zen-icons/forward.svg);
position: absolute;
bottom: 10%;
padding: 0.8em !important;
}
#zen-welcome-title {

View File

@@ -18,7 +18,8 @@
super();
if (
!Services.prefs.getBoolPref('zen.theme.gradient', true) ||
!gZenWorkspaces.shouldHaveWorkspaces
!gZenWorkspaces.shouldHaveWorkspaces ||
gZenWorkspaces.privateWindowOrDisabled
) {
return;
}
@@ -427,7 +428,7 @@
dot.classList.add('zen-theme-picker-dot', 'hidden', 'custom');
dot.style.opacity = 0;
dot.style.setProperty('--zen-theme-picker-dot-color', color);
this.panel.querySelector('.zen-theme-picker-gradient').appendChild(dot);
this.panel.querySelector('#PanelUI-zen-gradient-generator-custom-list').prepend(dot);
this.customColorInput.value = '';
await this.updateCurrentWorkspace();
}
@@ -1088,7 +1089,7 @@
this.isDarkMode ? 0.2 : -0.5,
`rgb(${dominantColor[0]}, ${dominantColor[1]}, ${dominantColor[2]})`
);
const color = result?.match(/\d+/g).map(Number);
const color = result?.match(/\d+/g)?.map(Number);
if (!color || color.length !== 3) {
return this.getNativeAccentColor();
}
@@ -1121,29 +1122,20 @@
}
}
const appWrapper = browser.document.getElementById('browser');
if (!skipUpdate && !this._animatingBackground) {
this._animatingBackground = true;
appWrapper.removeAttribute('animating');
const appBackground = browser.document.getElementById('zen-browser-background');
if (!skipUpdate) {
browser.document.documentElement.style.setProperty(
'--zen-main-browser-background-old',
browser.document.documentElement.style.getPropertyValue('--zen-main-browser-background')
);
browser.window.requestAnimationFrame(() => {
appWrapper.setAttribute('animating', 'true');
setTimeout(() => {
this._animatingBackground = false;
appWrapper.removeAttribute('animating');
appWrapper.setAttribute('post-animating', 'true');
browser.document.documentElement.style.removeProperty(
'--zen-main-browser-background-old'
);
setTimeout(() => {
// Reactivate the transition after the animation
appWrapper.removeAttribute('post-animating');
}, 100);
}, 300);
});
browser.document.documentElement.style.setProperty(
'--zen-background-opacity',
browser.gZenThemePicker.previousBackgroundOpacity
);
if (browser.gZenThemePicker.previousBackgroundResolve) {
browser.gZenThemePicker.previousBackgroundResolve();
}
delete browser.gZenThemePicker.previousBackgroundOpacity;
}
const button = browser.document.getElementById(
@@ -1264,6 +1256,7 @@
);
browser.gZenThemePicker.updateNoise(workspaceTheme.texture);
browser.gZenThemePicker.customColorList.innerHTML = '';
for (const dot of workspaceTheme.gradientColors) {
if (dot.isCustom) {
browser.gZenThemePicker.addColorToCustomList(dot.c);

View File

@@ -37,10 +37,13 @@
}
connectedCallback() {
if (this.delayConnectedCallback()) {
if (this.delayConnectedCallback() || this._hasConnected) {
// If we are not ready yet, or if we have already connected, we
// don't need to do anything.
return;
}
this._hasConnected = true;
this.appendChild(this.constructor.fragment);
this.tabsContainer = this.querySelector('.zen-workspace-normal-tabs-section');
@@ -54,9 +57,9 @@
false
);
this.scrollbox.addEventListener('wheel', gBrowser.tabContainer, true);
this.scrollbox.addEventListener('underflow', gBrowser.tabContainer);
this.scrollbox.addEventListener('overflow', gBrowser.tabContainer);
this.scrollbox.addEventListener('wheel', this, true);
this.scrollbox.addEventListener('underflow', this);
this.scrollbox.addEventListener('overflow', this);
this.scrollbox._getScrollableElements = () => {
const children = [...this.pinnedTabsContainer.children, ...this.tabsContainer.children];
@@ -119,6 +122,8 @@
this.tabsContainer.setAttribute('zen-workspace-id', this.id);
this.pinnedTabsContainer.setAttribute('zen-workspace-id', this.id);
this.#updateOverflow();
this.dispatchEvent(
new CustomEvent('ZenWorkspaceAttached', {
bubbles: true,
@@ -127,6 +132,42 @@
})
);
}
get active() {
return this.hasAttribute('active');
}
set active(value) {
if (value) {
this.setAttribute('active', 'true');
} else {
this.removeAttribute('active');
}
this.#updateOverflow();
}
#updateOverflow() {
if (!this.scrollbox) return;
if (this.overflows) {
this.#dispatchEventFromScrollbox('overflow');
} else {
this.#dispatchEventFromScrollbox('underflow');
}
}
#dispatchEventFromScrollbox(type) {
this.scrollbox.dispatchEvent(new CustomEvent(type, {}));
}
get overflows() {
return this.scrollbox.overflowing;
}
handleEvent(event) {
if (this.active) {
gBrowser.tabContainer.handleEvent(event);
}
}
}
customElements.define('zen-workspace', ZenWorkspace);

View File

@@ -5,10 +5,11 @@
}
connectedCallback() {
if (this.delayConnectedCallback()) {
if (this.delayConnectedCallback() || this._hasConnected) {
return;
}
this._hasConnected = true;
window.addEventListener('ZenWorkspacesUIUpdate', this, true);
}

View File

@@ -48,6 +48,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
`;
async waitForPromises() {
if (this.privateWindowOrDisabled) {
return;
}
await Promise.all([
this.promiseDBInitialized,
this.promisePinnedInitialized,
@@ -115,6 +118,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
);
this._activeWorkspace = Services.prefs.getStringPref('zen.workspaces.active', '');
if (this.isPrivateWindow) {
document.documentElement.setAttribute('zen-private-window', 'true');
}
window.addEventListener('resize', this.onWindowResize.bind(this));
this.addPopupListeners();
}
@@ -136,21 +143,24 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
await this.initializeWorkspaces();
if (
Services.prefs.getBoolPref('zen.workspaces.swipe-actions', false) &&
this.workspaceEnabled
this.workspaceEnabled &&
!this.isPrivateWindow
) {
this.initializeGestureHandlers();
this.initializeWorkspaceNavigation();
}
Services.obs.addObserver(this, 'weave:engine:sync:finish');
Services.obs.addObserver(
async function observe(subject) {
this._workspaceBookmarksCache = null;
await this.workspaceBookmarks();
this._invalidateBookmarkContainers();
}.bind(this),
'workspace-bookmarks-updated'
);
if (!this.privateWindowOrDisabled) {
Services.obs.addObserver(this, 'weave:engine:sync:finish');
Services.obs.addObserver(
async function observe(subject) {
this._workspaceBookmarksCache = null;
await this.workspaceBookmarks();
this._invalidateBookmarkContainers();
}.bind(this),
'workspace-bookmarks-updated'
);
}
}
// Validate browser state before tab operations
@@ -423,6 +433,15 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
essentialsContainer.setAttribute('flex', '1');
essentialsContainer.setAttribute('container', container);
document.getElementById('zen-essentials').appendChild(essentialsContainer);
// Set an initial hidden state if the essentials section is not supposed
// to be shown on the current workspace
if (
this.containerSpecificEssentials &&
this.getActiveWorkspaceFromCache()?.containerTabId != container
) {
essentialsContainer.setAttribute('hidden', 'true');
}
}
return essentialsContainer;
}
@@ -434,10 +453,10 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
async _createWorkspaceTabsSection(workspace, tabs) {
const workspaceWrapper = document.createXULElement('zen-workspace');
const container = gBrowser.tabContainer.arrowScrollbox;
const container = document.getElementById('tabbrowser-arrowscrollbox');
workspaceWrapper.id = workspace.uuid;
if (this.activeWorkspace === workspace.uuid) {
workspaceWrapper.setAttribute('active', 'true');
workspaceWrapper.active = true;
}
await new Promise((resolve) => {
@@ -539,7 +558,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
toolbox.addEventListener(
'wheel',
async (event) => {
if (!this.workspaceEnabled) return;
if (this.privateWindowOrDisabled) return;
// Only process non-gesture scrolls
if (event.deltaMode !== 1) return;
@@ -618,7 +637,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
_handleSwipeMayStart(event) {
if (!this.workspaceEnabled || this._inChangingWorkspace) return;
if (this.privateWindowOrDisabled || this._inChangingWorkspace) return;
if (event.target.closest('#zen-sidebar-bottom-buttons')) return;
// Only handle horizontal swipes
@@ -697,6 +716,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
set activeWorkspace(value) {
this._activeWorkspace = value;
if (this.privateWindowOrDisabled) {
return;
}
Services.prefs.setStringPref('zen.workspaces.active', value);
}
@@ -725,7 +747,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (typeof this._shouldHaveWorkspaces === 'undefined') {
let docElement = document.documentElement;
this._shouldHaveWorkspaces = !(
PrivateBrowsingUtils.isWindowPrivate(window) ||
docElement.getAttribute('chromehidden').includes('toolbar') ||
docElement.getAttribute('chromehidden').includes('menubar')
);
@@ -734,6 +755,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this._shouldHaveWorkspaces;
}
get isPrivateWindow() {
return PrivateBrowsingUtils.isWindowPrivate(window);
}
get privateWindowOrDisabled() {
return this.isPrivateWindow || !this.shouldHaveWorkspaces;
}
get workspaceEnabled() {
if (typeof this._workspaceEnabled === 'undefined') {
this._workspaceEnabled =
@@ -760,6 +789,15 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
return this._workspaceCache;
}
if (this.isPrivateWindow) {
this._workspaceCache = {
workspaces: this._privateWorkspace ? [this._privateWorkspace] : [],
lastChangeTimestamp: 0,
};
this._activeWorkspace = this._privateWorkspace?.uuid;
return this._workspaceCache;
}
const [workspaces, lastChangeTimestamp] = await Promise.all([
ZenWorkspacesStorage.getWorkspaces(),
ZenWorkspacesStorage.getLastChangeTimestamp(),
@@ -1233,6 +1271,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async saveWorkspace(workspaceData, preventPropagation = false) {
if (this.privateWindowOrDisabled) {
return;
}
await ZenWorkspacesStorage.saveWorkspace(workspaceData);
if (!preventPropagation) {
await this._propagateWorkspaceData();
@@ -1374,10 +1415,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async _propagateWorkspaceData({ ignoreStrip = false, clearCache = true } = {}) {
const currentWindowIsPrivate = this.isPrivateWindow;
await this.foreachWindowAsActive(async (browser) => {
// Do not update the window if workspaces are not enabled in it.
// For example, when the window is in private browsing mode.
if (!browser.gZenWorkspaces.workspaceEnabled) {
if (
!browser.gZenWorkspaces.workspaceEnabled ||
browser.gZenWorkspaces.isPrivateWindow !== currentWindowIsPrivate
) {
return;
}
@@ -1701,7 +1746,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async openWorkspacesDialog(event) {
if (!this.workspaceEnabled) {
if (!this.workspaceEnabled || this.isPrivateWindow) {
return;
}
let target = event.target.closest('.zen-current-workspace-indicator');
@@ -1902,11 +1947,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
// Refresh tab cache
for (const otherWorkspace of workspaces.workspaces) {
const container = this.workspaceElement(otherWorkspace.uuid);
if (otherWorkspace.uuid === workspace.uuid) {
container.setAttribute('active', 'true');
} else {
container.removeAttribute('active');
}
container.active = otherWorkspace.uuid === workspace.uuid;
}
gBrowser.verticalPinnedTabsContainer =
this.pinnedTabsContainer || gBrowser.verticalPinnedTabsContainer;
@@ -2097,6 +2138,42 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
essentialsContainer.parentNode.appendChild(essentialsClone);
}
}
document.documentElement.setAttribute('animating-background', 'true');
if (shouldAnimate && previousWorkspace) {
let previousBackgroundOpacity = document.documentElement.style.getPropertyValue(
'--zen-background-opacity'
);
try {
// Prevent NaN from being set
if (previousBackgroundOpacity) {
previousBackgroundOpacity = parseFloat(previousBackgroundOpacity);
}
} catch (e) {
previousBackgroundOpacity = 1;
}
if (previousBackgroundOpacity == 1 || !previousBackgroundOpacity) {
previousBackgroundOpacity = 0;
}
gZenThemePicker.previousBackgroundOpacity = previousBackgroundOpacity;
await new Promise((resolve) => {
requestAnimationFrame(() => {
animations.push(
gZenUIManager.motion.animate(
document.documentElement,
{
'--zen-background-opacity': [previousBackgroundOpacity, 1],
},
{
type: 'spring',
bounce: 0,
duration: kGlobalAnimationDuration,
}
)
);
resolve();
});
});
}
for (const element of document.querySelectorAll('zen-workspace')) {
if (element.classList.contains('zen-essentials-container')) {
continue;
@@ -2127,13 +2204,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
)
);
}
element.active = offset === 0;
if (offset === 0) {
element.setAttribute('active', 'true');
if (tabToSelect != gBrowser.selectedTab && !onInit) {
gBrowser.selectedTab = tabToSelect;
}
} else {
element.removeAttribute('active');
}
}
if (this.containerSpecificEssentials && previousWorkspace) {
@@ -2275,6 +2350,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
gZenUIManager.updateTabsToolbar();
}
await Promise.all(animations);
document.documentElement.removeAttribute('animating-background');
if (shouldAnimate) {
for (const cloned of clonedEssentials) {
cloned.container.remove();
@@ -2486,6 +2562,7 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
async _updateWorkspacesChangeContextMenu() {
if (gZenWorkspaces.privateWindowOrDisabled) return;
const workspaces = await this._workspaces();
const menuPopup = document.getElementById('context-zen-change-workspace-tab-menu-popup');
@@ -2510,8 +2587,8 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
}
}
_createWorkspaceData(name, icon, tabs, moveTabs = true, containerTabId = 0) {
let window = {
async _createWorkspaceData(name, icon, tabs, moveTabs = true, containerTabId = 0) {
let workspace = {
uuid: gZenUIManager.generateUuidv4(),
icon: icon,
name: name,
@@ -2519,10 +2596,11 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
containerTabId,
};
if (moveTabs) {
this._prepareNewWorkspace(window);
this._createWorkspaceTabsSection(window, tabs);
this._prepareNewWorkspace(workspace);
await this._createWorkspaceTabsSection(workspace, tabs);
await this._organizeWorkspaceStripLocations(workspace);
}
return window;
return workspace;
}
async createAndSaveWorkspace(
@@ -2534,6 +2612,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
if (!this.workspaceEnabled) {
return;
}
if (this.isPrivateWindow) {
name = 'Private ' + name;
}
// get extra tabs remaning (e.g. on new profiles) and just move them to the new workspace
const extraTabs = Array.from(gBrowser.tabContainer.arrowScrollbox.children).filter(
(child) =>
@@ -2542,14 +2623,18 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
!child.hasAttribute('zen-empty-tab') &&
!child.hasAttribute('zen-essential')
);
let workspaceData = this._createWorkspaceData(
let workspaceData = await this._createWorkspaceData(
name,
icon,
extraTabs,
!dontChange,
containerTabId
);
await this.saveWorkspace(workspaceData, dontChange);
if (this.isPrivateWindow) {
this._privateWorkspace = workspaceData;
} else {
await this.saveWorkspace(workspaceData, dontChange);
}
if (!dontChange) {
this.registerPinnedResizeObserver();
let changed = extraTabs.length > 0;

View File

@@ -447,7 +447,7 @@
position: relative;
max-height: var(--zen-workspace-indicator-height);
min-height: var(--zen-workspace-indicator-height);
gap: var(--tab-icon-end-margin);
gap: 10px;
align-items: center;
flex-direction: row !important;
max-width: 100%;
@@ -466,10 +466,12 @@
height: calc(100% - var(--zen-toolbox-padding) * 2);
}
&:hover,
&[open='true'] {
&::before {
background: var(--tab-hover-background-color);
:root:not([zen-private-window]) & {
&:hover,
&[open='true'] {
&::before {
background: var(--tab-hover-background-color);
}
}
}

View File

@@ -19,7 +19,7 @@
"brandShortName": "Zen",
"brandFullName": "Zen Browser",
"release": {
"displayVersion": "1.12.6b",
"displayVersion": "1.12.8b",
"github": {
"repo": "zen-browser/desktop"
},