mirror of
https://github.com/zen-browser/desktop.git
synced 2025-09-07 11:58:20 +00:00
Compare commits
6 Commits
1.15.1b
...
fix-expand
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7c221f1a82 | ||
![]() |
d6ec4d12d8 | ||
![]() |
2d81cd2087 | ||
![]() |
7beb3d5a9c | ||
![]() |
ce5dc06c66 | ||
![]() |
64cb61ec9f |
@@ -1,5 +1,5 @@
|
|||||||
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
diff --git a/browser/components/tabbrowser/content/tabbrowser.js b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c1ec15e92 100644
|
index d80a66a01002e78a9c65545d08fe786328ddf124..bb57b1eeb033f602d5014ab23e2cc1389bb9e615 100644
|
||||||
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
--- a/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
+++ b/browser/components/tabbrowser/content/tabbrowser.js
|
||||||
@@ -422,15 +422,60 @@
|
@@ -422,15 +422,60 @@
|
||||||
@@ -337,7 +337,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
if (!tab) {
|
if (!tab) {
|
||||||
let createLazyBrowser =
|
let createLazyBrowser =
|
||||||
- restoreTabsLazily && !select && !tabData.pinned;
|
- restoreTabsLazily && !select && !tabData.pinned;
|
||||||
+ restoreTabsLazily && !tabData.pinned;
|
+ restoreTabsLazily;
|
||||||
|
|
||||||
let url = "about:blank";
|
let url = "about:blank";
|
||||||
if (tabData.entries?.length) {
|
if (tabData.entries?.length) {
|
||||||
@@ -391,10 +391,10 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
+ gZenWorkspaces._initialTab._shouldRemove = true;
|
||||||
+ }
|
+ }
|
||||||
+ }
|
+ }
|
||||||
}
|
+ }
|
||||||
+ else {
|
+ else {
|
||||||
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
+ gZenWorkspaces._tabToRemoveForEmpty = this.selectedTab;
|
||||||
+ }
|
}
|
||||||
+ this._hasAlreadyInitializedZenSessionStore = true;
|
+ this._hasAlreadyInitializedZenSessionStore = true;
|
||||||
|
|
||||||
if (tabs.length > 1 || !tabs[0].selected) {
|
if (tabs.length > 1 || !tabs[0].selected) {
|
||||||
@@ -606,7 +606,15 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
aTab.selected ||
|
aTab.selected ||
|
||||||
aTab.closing ||
|
aTab.closing ||
|
||||||
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
// Tabs that are sharing the screen, microphone or camera cannot be hidden.
|
||||||
@@ -5972,7 +6103,7 @@
|
@@ -5839,6 +5970,7 @@
|
||||||
|
* @param {MozTabbrowserTab|MozTabbrowserTabGroup|MozTabbrowserTabGroup.labelElement} aTab
|
||||||
|
*/
|
||||||
|
replaceTabWithWindow(aTab, aOptions) {
|
||||||
|
+ if (!this.isTab(aTab)) return; // TODO: Handle tab groups
|
||||||
|
if (this.tabs.length == 1) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
@@ -5972,7 +6104,7 @@
|
||||||
* `true` if element is a `<tab-group>`
|
* `true` if element is a `<tab-group>`
|
||||||
*/
|
*/
|
||||||
isTabGroup(element) {
|
isTabGroup(element) {
|
||||||
@@ -615,7 +623,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -6049,7 +6180,7 @@
|
@@ -6049,7 +6181,7 @@
|
||||||
|
|
||||||
// Don't allow mixing pinned and unpinned tabs.
|
// Don't allow mixing pinned and unpinned tabs.
|
||||||
if (this.isTab(element) && element.pinned) {
|
if (this.isTab(element) && element.pinned) {
|
||||||
@@ -624,7 +632,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
} else {
|
} else {
|
||||||
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
tabIndex = Math.max(tabIndex, this.pinnedTabCount);
|
||||||
}
|
}
|
||||||
@@ -6075,10 +6206,16 @@
|
@@ -6075,10 +6207,16 @@
|
||||||
this.#handleTabMove(
|
this.#handleTabMove(
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
@@ -643,7 +651,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
if (neighbor && this.isTab(element) && tabIndex > element._tPos) {
|
||||||
neighbor.after(element);
|
neighbor.after(element);
|
||||||
} else {
|
} else {
|
||||||
@@ -6136,22 +6273,23 @@
|
@@ -6136,22 +6274,23 @@
|
||||||
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
#moveTabNextTo(element, targetElement, moveBefore = false, metricsContext) {
|
||||||
if (this.isTabGroupLabel(targetElement)) {
|
if (this.isTabGroupLabel(targetElement)) {
|
||||||
targetElement = targetElement.group;
|
targetElement = targetElement.group;
|
||||||
@@ -673,7 +681,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
moveBefore = false;
|
moveBefore = false;
|
||||||
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
} else if (!element.pinned && targetElement && targetElement.pinned) {
|
||||||
// If the caller asks to move an unpinned element next to a pinned
|
// If the caller asks to move an unpinned element next to a pinned
|
||||||
@@ -6165,14 +6303,34 @@
|
@@ -6165,14 +6304,34 @@
|
||||||
// move the tab group right before the first unpinned tab.
|
// move the tab group right before the first unpinned tab.
|
||||||
// 4. Moving a tab group and the first unpinned tab is grouped:
|
// 4. Moving a tab group and the first unpinned tab is grouped:
|
||||||
// move the tab group right before the first unpinned tab's tab group.
|
// move the tab group right before the first unpinned tab's tab group.
|
||||||
@@ -709,7 +717,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
element.pinned
|
element.pinned
|
||||||
? this.tabContainer.pinnedTabsContainer
|
? this.tabContainer.pinnedTabsContainer
|
||||||
: this.tabContainer;
|
: this.tabContainer;
|
||||||
@@ -6181,7 +6339,7 @@
|
@@ -6181,7 +6340,7 @@
|
||||||
element,
|
element,
|
||||||
() => {
|
() => {
|
||||||
if (moveBefore) {
|
if (moveBefore) {
|
||||||
@@ -718,7 +726,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
} else if (targetElement) {
|
} else if (targetElement) {
|
||||||
targetElement.after(element);
|
targetElement.after(element);
|
||||||
} else {
|
} else {
|
||||||
@@ -6227,10 +6385,10 @@
|
@@ -6227,10 +6386,10 @@
|
||||||
* @param {TabMetricsContext} [metricsContext]
|
* @param {TabMetricsContext} [metricsContext]
|
||||||
*/
|
*/
|
||||||
moveTabToGroup(aTab, aGroup, metricsContext) {
|
moveTabToGroup(aTab, aGroup, metricsContext) {
|
||||||
@@ -731,7 +739,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (aTab.group && aTab.group.id === aGroup.id) {
|
if (aTab.group && aTab.group.id === aGroup.id) {
|
||||||
@@ -6324,6 +6482,10 @@
|
@@ -6324,6 +6483,10 @@
|
||||||
|
|
||||||
moveActionCallback();
|
moveActionCallback();
|
||||||
|
|
||||||
@@ -742,7 +750,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
// Clear tabs cache after moving nodes because the order of tabs may have
|
// Clear tabs cache after moving nodes because the order of tabs may have
|
||||||
// changed.
|
// changed.
|
||||||
this.tabContainer._invalidateCachedTabs();
|
this.tabContainer._invalidateCachedTabs();
|
||||||
@@ -7221,7 +7383,7 @@
|
@@ -7221,7 +7384,7 @@
|
||||||
// preventDefault(). It will still raise the window if appropriate.
|
// preventDefault(). It will still raise the window if appropriate.
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -751,7 +759,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
window.focus();
|
window.focus();
|
||||||
aEvent.preventDefault();
|
aEvent.preventDefault();
|
||||||
break;
|
break;
|
||||||
@@ -8166,6 +8328,7 @@
|
@@ -8166,6 +8329,7 @@
|
||||||
aWebProgress.isTopLevel
|
aWebProgress.isTopLevel
|
||||||
) {
|
) {
|
||||||
this.mTab.setAttribute("busy", "true");
|
this.mTab.setAttribute("busy", "true");
|
||||||
@@ -759,7 +767,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
gBrowser._tabAttrModified(this.mTab, ["busy"]);
|
||||||
this.mTab._notselectedsinceload = !this.mTab.selected;
|
this.mTab._notselectedsinceload = !this.mTab.selected;
|
||||||
}
|
}
|
||||||
@@ -9157,7 +9320,7 @@ var TabContextMenu = {
|
@@ -9157,7 +9321,7 @@ var TabContextMenu = {
|
||||||
);
|
);
|
||||||
contextUnpinSelectedTabs.hidden =
|
contextUnpinSelectedTabs.hidden =
|
||||||
!this.contextTab.pinned || !this.multiselected;
|
!this.contextTab.pinned || !this.multiselected;
|
||||||
@@ -768,7 +776,7 @@ index d80a66a01002e78a9c65545d08fe786328ddf124..1c01a1931a2d0b98f2d8f9a3b27e565c
|
|||||||
// Build Ask Chat items
|
// Build Ask Chat items
|
||||||
TabContextMenu.GenAI.buildTabMenu(
|
TabContextMenu.GenAI.buildTabMenu(
|
||||||
document.getElementById("context_askChat"),
|
document.getElementById("context_askChat"),
|
||||||
@@ -9476,6 +9639,7 @@ var TabContextMenu = {
|
@@ -9476,6 +9640,7 @@ var TabContextMenu = {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
} else {
|
} else {
|
||||||
|
@@ -178,17 +178,16 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
#initEventListeners() {
|
#initEventListeners() {
|
||||||
window.addEventListener('TabGrouped', this.#onTabGrouped.bind(this));
|
window.addEventListener('TabGrouped', this);
|
||||||
window.addEventListener('TabUngrouped', this.#onTabUngrouped.bind(this));
|
window.addEventListener('TabUngrouped', this);
|
||||||
window.addEventListener('TabGroupRemoved', this.#onTabGroupRemoved.bind(this));
|
window.addEventListener('TabGroupCreate', this);
|
||||||
window.addEventListener('TabGroupCreate', this.#onTabGroupCreate.bind(this));
|
window.addEventListener('TabPinned', this);
|
||||||
window.addEventListener('TabPinned', this.#onTabPinned.bind(this));
|
window.addEventListener('TabUnpinned', this);
|
||||||
window.addEventListener('TabUnpinned', this.#onTabUnpinned.bind(this));
|
window.addEventListener('TabGroupExpand', this);
|
||||||
window.addEventListener('TabGroupExpand', this.#onTabGroupExpand.bind(this));
|
window.addEventListener('TabGroupCollapse', this);
|
||||||
window.addEventListener('TabGroupCollapse', this.#onTabGroupCollapse.bind(this));
|
window.addEventListener('FolderGrouped', this);
|
||||||
window.addEventListener('FolderGrouped', this.#onFolderGrouped.bind(this));
|
window.addEventListener('TabSelect', this);
|
||||||
window.addEventListener('TabSelect', this.#onTabSelected.bind(this));
|
window.addEventListener('TabOpen', this);
|
||||||
window.addEventListener('TabOpen', this.#onTabOpened.bind(this));
|
|
||||||
const onNewFolder = this.#onNewFolder.bind(this);
|
const onNewFolder = this.#onNewFolder.bind(this);
|
||||||
document
|
document
|
||||||
.getElementById('zen-context-menu-new-folder')
|
.getElementById('zen-context-menu-new-folder')
|
||||||
@@ -201,7 +200,16 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabGrouped(event) {
|
handleEvent(aEvent) {
|
||||||
|
let methodName = `on_${aEvent.type}`;
|
||||||
|
if (methodName in this) {
|
||||||
|
this[methodName](aEvent);
|
||||||
|
} else {
|
||||||
|
throw new Error(`Unexpected event ${aEvent.type}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
on_TabGrouped(event) {
|
||||||
const tab = event.detail;
|
const tab = event.detail;
|
||||||
const group = tab.group;
|
const group = tab.group;
|
||||||
group.pinned = tab.pinned;
|
group.pinned = tab.pinned;
|
||||||
@@ -218,16 +226,19 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#onFolderGrouped(event) {
|
on_FolderGrouped(event) {
|
||||||
if (this._sessionRestoring) return;
|
if (this._sessionRestoring) return;
|
||||||
const folder = event.detail;
|
const folder = event.detail;
|
||||||
folder.group.collapsed = false;
|
folder.group.collapsed = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onTabSelected() {
|
async on_TabSelect(event) {
|
||||||
const tab = event.target;
|
const tab = event.target;
|
||||||
const group = tab?.group;
|
let group = tab?.group;
|
||||||
if (!group?.isZenFolder) return;
|
if (group?.hasAttribute('split-view-group')) group = group?.group;
|
||||||
|
if (!group?.isZenFolder || tab.hasAttribute('folder-active')) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
const collapsedRoot = group.rootMostCollapsedFolder;
|
const collapsedRoot = group.rootMostCollapsedFolder;
|
||||||
if (!collapsedRoot) {
|
if (!collapsedRoot) {
|
||||||
@@ -239,7 +250,7 @@
|
|||||||
gBrowser.tabContainer._invalidateCachedTabs();
|
gBrowser.tabContainer._invalidateCachedTabs();
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabOpened(event) {
|
on_TabOpen(event) {
|
||||||
const tab = event.target;
|
const tab = event.target;
|
||||||
const group = tab.group;
|
const group = tab.group;
|
||||||
if (!group?.isZenFolder || tab.pinned) return;
|
if (!group?.isZenFolder || tab.pinned) return;
|
||||||
@@ -256,7 +267,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabUngrouped(event) {
|
on_TabUngrouped(event) {
|
||||||
const tab = event.detail;
|
const tab = event.detail;
|
||||||
const group = event.target;
|
const group = event.target;
|
||||||
tab.removeAttribute('folder-active');
|
tab.removeAttribute('folder-active');
|
||||||
@@ -276,7 +287,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabGroupCreate(event) {
|
on_TabGroupCreate(event) {
|
||||||
const group = event.target;
|
const group = event.target;
|
||||||
const tabs = group.tabs;
|
const tabs = group.tabs;
|
||||||
if (!group.pinned) {
|
if (!group.pinned) {
|
||||||
@@ -290,9 +301,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabGroupRemoved() {}
|
on_TabPinned(event) {
|
||||||
|
|
||||||
#onTabPinned(event) {
|
|
||||||
const tab = event.target;
|
const tab = event.target;
|
||||||
const group = tab.group;
|
const group = tab.group;
|
||||||
if (group && group.hasAttribute('split-view-group')) {
|
if (group && group.hasAttribute('split-view-group')) {
|
||||||
@@ -300,7 +309,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#onTabUnpinned(event) {
|
on_TabUnpinned(event) {
|
||||||
const tab = event.target;
|
const tab = event.target;
|
||||||
const group = tab.group;
|
const group = tab.group;
|
||||||
if (group && group.hasAttribute('split-view-group')) {
|
if (group && group.hasAttribute('split-view-group')) {
|
||||||
@@ -316,7 +325,7 @@
|
|||||||
this.#popup.hidePopup();
|
this.#popup.hidePopup();
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onTabGroupCollapse(event) {
|
async on_TabGroupCollapse(event) {
|
||||||
const group = event.target;
|
const group = event.target;
|
||||||
if (!group.isZenFolder) return;
|
if (!group.isZenFolder) return;
|
||||||
|
|
||||||
@@ -444,7 +453,7 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onTabGroupExpand(event) {
|
async on_TabGroupExpand(event) {
|
||||||
const group = event.target;
|
const group = event.target;
|
||||||
if (!group.isZenFolder) return;
|
if (!group.isZenFolder) return;
|
||||||
|
|
||||||
@@ -507,7 +516,9 @@
|
|||||||
const groupItems = normalizeGroupItems(group.childGroupsAndTabs);
|
const groupItems = normalizeGroupItems(group.childGroupsAndTabs);
|
||||||
const itemsToHide = [];
|
const itemsToHide = [];
|
||||||
|
|
||||||
|
// TODO: It is necessary to correctly set marginTop for groups with has-active
|
||||||
for (const activeGroup of activeGroups) {
|
for (const activeGroup of activeGroups) {
|
||||||
|
const activeGroupItems = activeGroup.childGroupsAndTabs;
|
||||||
let selectedTabs = activeGroup.activeTabs;
|
let selectedTabs = activeGroup.activeTabs;
|
||||||
let selectedGroupIds = new Set();
|
let selectedGroupIds = new Set();
|
||||||
|
|
||||||
@@ -519,7 +530,7 @@
|
|||||||
|
|
||||||
if (selectedTabs.length) {
|
if (selectedTabs.length) {
|
||||||
let selectedIdx = -1;
|
let selectedIdx = -1;
|
||||||
for (let i = 0; i < activeGroup.childGroupsAndTabs.length; i++) {
|
for (let i = 0; i < activeGroupItems.length; i++) {
|
||||||
const item = activeGroup.childGroupsAndTabs[i];
|
const item = activeGroup.childGroupsAndTabs[i];
|
||||||
let selectedTab = item;
|
let selectedTab = item;
|
||||||
|
|
||||||
@@ -535,7 +546,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (selectedIdx >= 0) {
|
if (selectedIdx >= 0) {
|
||||||
for (let i = selectedIdx; i < activeGroup.childGroupsAndTabs.length; i++) {
|
for (let i = selectedIdx; i < activeGroupItems.length; i++) {
|
||||||
const item = activeGroup.childGroupsAndTabs[i];
|
const item = activeGroup.childGroupsAndTabs[i];
|
||||||
|
|
||||||
if (selectedTabs.includes(item)) continue;
|
if (selectedTabs.includes(item)) continue;
|
||||||
@@ -1002,7 +1013,7 @@
|
|||||||
|
|
||||||
const secondaryLabel = document.createElement('div');
|
const secondaryLabel = document.createElement('div');
|
||||||
secondaryLabel.className = 'tab-list-item-secondary-label';
|
secondaryLabel.className = 'tab-list-item-secondary-label';
|
||||||
secondaryLabel.textContent = formatRelativeTime(tab.lastAccessed);
|
secondaryLabel.textContent = `${formatRelativeTime(tab.lastAccessed)} • ${tab.group.label}`;
|
||||||
|
|
||||||
labelsContainer.append(mainLabel, secondaryLabel);
|
labelsContainer.append(mainLabel, secondaryLabel);
|
||||||
content.append(icon, labelsContainer);
|
content.append(icon, labelsContainer);
|
||||||
@@ -1226,7 +1237,7 @@
|
|||||||
{
|
{
|
||||||
marginTop: newMargin,
|
marginTop: newMargin,
|
||||||
},
|
},
|
||||||
{ duration: 0.15, ease: 'easeInOut' }
|
{ duration: 0.1, ease: 'easeInOut' }
|
||||||
)
|
)
|
||||||
.then(() => {
|
.then(() => {
|
||||||
selectedTab.style.removeProperty('--zen-folder-indent');
|
selectedTab.style.removeProperty('--zen-folder-indent');
|
||||||
@@ -1254,7 +1265,7 @@
|
|||||||
{
|
{
|
||||||
marginTop: [newMargin, oldMargin],
|
marginTop: [newMargin, oldMargin],
|
||||||
},
|
},
|
||||||
{ duration: 0.15, ease: 'easeInOut' }
|
{ duration: 0.1, ease: 'easeInOut' }
|
||||||
);
|
);
|
||||||
groupStart.removeAttribute('old-margin');
|
groupStart.removeAttribute('old-margin');
|
||||||
groupStart.removeAttribute('new-margin');
|
groupStart.removeAttribute('new-margin');
|
||||||
@@ -1297,57 +1308,42 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Always new selected item
|
for (const tab of selectedItems) {
|
||||||
let current = selectedItems?.at(-1)?.group;
|
let current = tab?.group?.hasAttribute('split-view-group') ? tab.group.group : tab?.group;
|
||||||
while (current) {
|
while (current) {
|
||||||
const activeForGroup = selectedItems.filter((t) => current.contains(t));
|
const activeForGroup = selectedItems.filter((t) => current.contains(t));
|
||||||
if (activeForGroup.length) {
|
if (activeForGroup.length) {
|
||||||
current.activeTabs = activeForGroup;
|
if (current.collapsed) {
|
||||||
|
current.setAttribute('has-active', 'true');
|
||||||
|
current.activeTabs = activeForGroup;
|
||||||
|
const tabsContainer = current.querySelector('.tab-group-container');
|
||||||
|
const groupStart = current.querySelector('.zen-tab-group-start');
|
||||||
|
const curMarginTop = parseInt(groupStart.style.marginTop) || 0;
|
||||||
|
|
||||||
if (current.collapsed) {
|
if (tabsContainer.hasAttribute('hidden')) tabsContainer.removeAttribute('hidden');
|
||||||
const tabsContainer = current.querySelector('.tab-group-container');
|
|
||||||
const groupStart = current.querySelector('.zen-tab-group-start');
|
|
||||||
|
|
||||||
if (tabsContainer.hasAttribute('hidden')) tabsContainer.removeAttribute('hidden');
|
animations.push(...this.updateFolderIcon(current, 'close', false));
|
||||||
|
animations.push(
|
||||||
let heightUntilSelected;
|
gZenUIManager.motion.animate(
|
||||||
if (activeForGroup.length) {
|
groupStart,
|
||||||
const selectedItem = activeForGroup[0];
|
{
|
||||||
const isSplitView = selectedItem.group?.hasAttribute('split-view-group');
|
marginTop: [curMarginTop, 0],
|
||||||
const selectedContainer = isSplitView ? selectedItem.group : selectedItem;
|
},
|
||||||
heightUntilSelected =
|
{ duration: 0.1, ease: 'easeInOut' }
|
||||||
window.windowUtils.getBoundsWithoutFlushing(selectedContainer).top -
|
)
|
||||||
window.windowUtils.getBoundsWithoutFlushing(groupStart).bottom;
|
);
|
||||||
if (isSplitView) {
|
for (const tab of activeForGroup) {
|
||||||
heightUntilSelected -= 2;
|
this.setFolderIndentation(
|
||||||
|
[tab],
|
||||||
|
current,
|
||||||
|
/* for collapse = */ true,
|
||||||
|
/* animate = */ false
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
heightUntilSelected =
|
|
||||||
window.windowUtils.getBoundsWithoutFlushing(tabsContainer).height;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
animations.push(...this.updateFolderIcon(current, 'close', false));
|
|
||||||
animations.push(
|
|
||||||
gZenUIManager.motion.animate(
|
|
||||||
groupStart,
|
|
||||||
{
|
|
||||||
marginTop: [0, -(heightUntilSelected + 4 * (selectedItems.length === 0 ? 1 : 0))],
|
|
||||||
},
|
|
||||||
{ duration: 0.1, ease: 'easeInOut' }
|
|
||||||
)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
for (const tab of activeForGroup) {
|
|
||||||
this.setFolderIndentation(
|
|
||||||
[tab],
|
|
||||||
current,
|
|
||||||
/* for collapse = */ true,
|
|
||||||
/* animate = */ false
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
current = current.group;
|
||||||
}
|
}
|
||||||
current = current.group;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const selectedItemsSet = new Set();
|
const selectedItemsSet = new Set();
|
||||||
@@ -1442,7 +1438,7 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (group.collapsed) {
|
if (group.collapsed) {
|
||||||
this.#onTabGroupCollapse({ target: group });
|
this.on_TabGroupCollapse({ target: group });
|
||||||
}
|
}
|
||||||
|
|
||||||
const labelContainer = group.querySelector('.tab-group-label-container');
|
const labelContainer = group.querySelector('.tab-group-label-container');
|
||||||
|
@@ -1093,7 +1093,7 @@
|
|||||||
color = this.blendColors(
|
color = this.blendColors(
|
||||||
color.c,
|
color.c,
|
||||||
this.getToolbarModifiedBaseRaw().slice(0, 3),
|
this.getToolbarModifiedBaseRaw().slice(0, 3),
|
||||||
opacity * 100
|
90
|
||||||
);
|
);
|
||||||
opacity = 1; // Toolbar colors should always be fully opaque
|
opacity = 1; // Toolbar colors should always be fully opaque
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user