Refactor tab renaming logic to ensure consistent label handling and add animation effect; update CSS for vertical tabs to improve styling

This commit is contained in:
mr. M
2025-02-15 02:10:37 +01:00
parent af663d3656
commit a5e34fc9a5
2 changed files with 13 additions and 1 deletions

View File

@@ -624,14 +624,23 @@ var gZenVerticalTabsManager = {
let newName = input.value.trim(); let newName = input.value.trim();
// Check if name is blank, reset if so // Check if name is blank, reset if so
// Always remove, so we can always rename and if it's empty,
// it will reset to the original name anyway
this._tabEdited.removeAttribute('zen-has-static-label');
if (newName) { if (newName) {
gBrowser._setTabLabel(this._tabEdited, newName); gBrowser._setTabLabel(this._tabEdited, newName);
this._tabEdited.setAttribute('zen-has-static-label', 'true'); this._tabEdited.setAttribute('zen-has-static-label', 'true');
} else { } else {
this._tabEdited.removeAttribute('zen-has-static-label');
gBrowser.setTabTitle(this._tabEdited); gBrowser.setTabTitle(this._tabEdited);
} }
// Maybe add some confetti here?!?
gZenUIManager.motion.animate(this._tabEdited, {
scale: [1, 0.98, 1],
}, {
duration: 0.25,
});
this._tabEdited.querySelector('.tab-editor-container').remove(); this._tabEdited.querySelector('.tab-editor-container').remove();
label.classList.remove('tab-label-container-editing'); label.classList.remove('tab-label-container-editing');

View File

@@ -1148,6 +1148,9 @@
white-space: nowrap; white-space: nowrap;
overflow-x: scroll; overflow-x: scroll;
margin: 0; margin: 0;
background: transparent;
border: none;
padding: 0;
} }
/* Section: tab workspaces stylings */ /* Section: tab workspaces stylings */