Enhance UI styles and functionality for gradient generator, vertical tabs, and URL bar; improve tab management logic

This commit is contained in:
mr. M
2025-02-21 11:32:48 +01:00
parent a90c6c445c
commit 6771b137ea
8 changed files with 49 additions and 25 deletions

View File

@@ -114,6 +114,7 @@
userContextId,
}),
});
this.resetPinChangedUrl(tab);
}
get enabled() {
@@ -215,6 +216,16 @@
gBrowser._setTabLabel(tab, pin.title);
tab.setAttribute('zen-has-static-label', 'true');
}
// Reorder the tab if needed
if (tab._tPos !== pin.position) {
const parent = tab.parentNode;
const isEssential = tab.hasAttribute('zen-essential');
// If we arent an essential, we need to take into account
// that the last child is a separator
const childIndex = isEssential ? pin.position : Math.min(pin.position, parent.children.length - 1);
parent.insertBefore(tab, parent.children[childIndex]);
}
}
// Third pass: create new tabs for pins that don't have tabs
@@ -332,8 +343,6 @@
}
// Recollect pinned tabs and essentials after a tab move
const currentWorkspace = await ZenWorkspaces.getActiveWorkspace();
tab.position = tab._tPos;
for (let otherTab of gBrowser.tabs) {