From c9f632c1b8c7b210c61ffea52124e43494247ae3 Mon Sep 17 00:00:00 2001 From: "mr. m" Date: Sun, 18 May 2025 11:26:00 +0200 Subject: [PATCH] fix: Small fixes for workspaces icons, b=(no-bug), c=common, tabs, workspaces --- src/zen/common/styles/zen-popup.css | 4 ++-- src/zen/tabs/ZenPinnedTabManager.mjs | 4 ++-- src/zen/workspaces/ZenWorkspaceIcons.mjs | 12 ++++++++++-- src/zen/workspaces/ZenWorkspaces.mjs | 1 - 4 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/zen/common/styles/zen-popup.css b/src/zen/common/styles/zen-popup.css index c39fa8f82..3deb896b2 100644 --- a/src/zen/common/styles/zen-popup.css +++ b/src/zen/common/styles/zen-popup.css @@ -362,7 +362,7 @@ menuseparator { gap: 10px; z-index: 1000; padding: var(--zen-toast-padding); - border-radius: calc(var(--zen-native-inner-radius) + 8px); + border-radius: calc(var(--zen-native-inner-radius) + 6px); background: linear-gradient( 170deg, var(--zen-primary-color) -40%, @@ -397,7 +397,7 @@ menuseparator { padding: 0 12px !important; min-width: unset !important; margin: 0px !important; - border-radius: calc(var(--zen-native-inner-radius) + 4px) !important; + border-radius: calc(var(--zen-native-inner-radius) + 2px) !important; :root[zen-right-side='true'] & { order: -1; diff --git a/src/zen/tabs/ZenPinnedTabManager.mjs b/src/zen/tabs/ZenPinnedTabManager.mjs index 381a53f42..7389a7f7e 100644 --- a/src/zen/tabs/ZenPinnedTabManager.mjs +++ b/src/zen/tabs/ZenPinnedTabManager.mjs @@ -236,8 +236,8 @@ continue; } - if (pin.title && (pin.editedTitle || tab.hasAttribute('zen-has-static-label'))) { - tab.removeAttribute('zen-has-static-label'); // So we can set it again + tab.removeAttribute('zen-has-static-label'); // So we can set it again + if (pin.title && pin.editedTitle) { gBrowser._setTabLabel(tab, pin.title, { beforeTabOpen: true }); tab.setAttribute('zen-has-static-label', 'true'); } diff --git a/src/zen/workspaces/ZenWorkspaceIcons.mjs b/src/zen/workspaces/ZenWorkspaceIcons.mjs index 5e030453c..d51ac9e51 100644 --- a/src/zen/workspaces/ZenWorkspaceIcons.mjs +++ b/src/zen/workspaces/ZenWorkspaceIcons.mjs @@ -58,21 +58,29 @@ set activeIndex(uuid) { const buttons = this.querySelectorAll('toolbarbutton'); + let i = 0; + let selected = 0; for (const button of buttons) { if (button.getAttribute('zen-workspace-id') == uuid) { - button.setAttribute('active', 'true'); + selected = i; } else { button.removeAttribute('active'); } + selected++; } + buttons[selected].setAttribute('active', true); + this.setAttribute('selected', selected); } get activeIndex() { + const selected = this.getAttribute('selected'); const buttons = this.querySelectorAll('toolbarbutton'); + let i = 0; for (const button of buttons) { - if (button.hasAttribute('active')) { + if (i == selected) { return button.getAttribute('zen-workspace-id'); } + i++; } return null; } diff --git a/src/zen/workspaces/ZenWorkspaces.mjs b/src/zen/workspaces/ZenWorkspaces.mjs index 9f1eba7c7..08f66882d 100644 --- a/src/zen/workspaces/ZenWorkspaces.mjs +++ b/src/zen/workspaces/ZenWorkspaces.mjs @@ -2410,7 +2410,6 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature { }); await this._organizeWorkspaceStripLocations(workspace, true); gZenUIManager.tabsWrapper.style.scrollbarWidth = ''; - this.workspaceIcons.activeIndex = workspace.uuid; // Notify listeners if (this._changeListeners?.length) {