1
0
Fork 1
mirror of https://github.com/zen-browser/desktop.git synced 2025-07-08 19:59:59 +02:00

Started working on nested groups

This commit is contained in:
mr. m 2025-04-08 15:48:36 +02:00
parent 225d17eb88
commit 6a23d198a4
No known key found for this signature in database
GPG key ID: 419302196C23B258
4 changed files with 77 additions and 62 deletions

View file

@ -1,5 +1,5 @@
diff --git a/browser/components/tabbrowser/content/tabgroup.js b/browser/components/tabbrowser/content/tabgroup.js
index 670fe2b309863102f63246e26194c8958e28bbb7..9585c7b8a2e35b29a7630fd6bd2e4a972a1700c7 100644
index 670fe2b309863102f63246e26194c8958e28bbb7..ba99c89d0aba16e8f77ed8493f0a97d151b02cb3 100644
--- a/browser/components/tabbrowser/content/tabgroup.js
+++ b/browser/components/tabbrowser/content/tabgroup.js
@@ -9,10 +9,13 @@
@ -10,11 +10,12 @@ index 670fe2b309863102f63246e26194c8958e28bbb7..9585c7b8a2e35b29a7630fd6bd2e4a97
+ <hbox class="tab-group-label-container" pack="center">
+ <image class="tab-group-folder-icon"/>
<label class="tab-group-label" role="button"/>
+ </hbox>
+ <vbox class="tab-group-container">
+ <html:div class="zen-tab-group-start" />
</vbox>
- </vbox>
- <html:slot/>
+ </hbox>
+ <html:div class="tab-group-container">
+ <html:div class="zen-tab-group-start" />
+ </html:div>
`;
/** @type {string} */
@ -27,16 +28,30 @@ index 670fe2b309863102f63246e26194c8958e28bbb7..9585c7b8a2e35b29a7630fd6bd2e4a97
this.#updateLabelAriaAttributes();
this.#updateCollapsedAriaAttributes();
@@ -213,7 +216,7 @@
@@ -213,7 +216,21 @@
}
get tabs() {
- return Array.from(this.children).filter(node => node.matches("tab"));
+ return Array.from(this.querySelector('.tab-group-container').children).filter(node => node.matches("tab"));
+ // add other group tabs if they are under this group
+ let childs = Array.from(this.querySelector('.tab-group-container').children);
+ for (let item of childs) {
+ if (item.tagName == "tab-group") {
+ childs = childs.concat(item.tabs);
+ }
+ }
+ return childs.filter(node => node.matches("tab"));
+ }
+
+ get group() {
+ if (this.parentElement?.parentElement?.tagName == "tab-group") {
+ return this.parentElement.parentElement;
+ }
+ return null;
}
/**
@@ -270,7 +273,7 @@
@@ -270,7 +287,7 @@
* @param {PointerEvent} event
*/
on_click(event) {