mirror of
https://github.com/zen-browser/desktop.git
synced 2025-10-16 06:46:12 +00:00
fix: Improved workspace icons generation, b=(no-bug), c=common, mods, workspaces
This commit is contained in:
@@ -58,7 +58,6 @@ var gZenUIManager = {
|
||||
});
|
||||
|
||||
window.addEventListener('TabClose', this.onTabClose.bind(this));
|
||||
this.tabsWrapper.addEventListener('scroll', this.saveScrollbarState.bind(this));
|
||||
|
||||
gZenMediaController.init();
|
||||
},
|
||||
|
@@ -181,7 +181,11 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent {
|
||||
}
|
||||
|
||||
async installTheme(theme) {
|
||||
await this.downloadThemeFileContents(theme);
|
||||
try {
|
||||
await this.downloadThemeFileContents(theme);
|
||||
} catch (e) {
|
||||
console.error('ZenThemeMarketplaceParent: Error installing theme', theme.id, e);
|
||||
}
|
||||
}
|
||||
|
||||
async checkForThemeChanges() {
|
||||
|
@@ -51,22 +51,25 @@
|
||||
}
|
||||
}
|
||||
|
||||
on_ZenWorkspacesUIUpdate(event) {
|
||||
this.#updateIcons();
|
||||
async on_ZenWorkspacesUIUpdate(event) {
|
||||
await this.#updateIcons();
|
||||
this.activeIndex = event.detail.activeIndex;
|
||||
}
|
||||
|
||||
set activeIndex(uuid) {
|
||||
const buttons = this.querySelectorAll('toolbarbutton');
|
||||
if (!buttons.length) {
|
||||
return;
|
||||
}
|
||||
let i = 0;
|
||||
let selected = 0;
|
||||
let selected = -1;
|
||||
for (const button of buttons) {
|
||||
if (button.getAttribute('zen-workspace-id') == uuid) {
|
||||
selected = i;
|
||||
} else {
|
||||
button.removeAttribute('active');
|
||||
}
|
||||
selected++;
|
||||
i++;
|
||||
}
|
||||
buttons[selected].setAttribute('active', true);
|
||||
this.setAttribute('selected', selected);
|
||||
|
@@ -1594,12 +1594,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
browser.gZenWorkspaces._workspaceBookmarksCache = null;
|
||||
}
|
||||
let workspaces = await browser.gZenWorkspaces._workspaces();
|
||||
browser.dispatchEvent(
|
||||
new CustomEvent('ZenWorkspacesUIUpdate', {
|
||||
bubbles: true,
|
||||
detail: { workspaces, activeIndex: browser.gZenWorkspaces.activeWorkspace },
|
||||
})
|
||||
);
|
||||
if (clearCache) {
|
||||
browser.dispatchEvent(
|
||||
new CustomEvent('ZenWorkspacesUIUpdate', {
|
||||
bubbles: true,
|
||||
detail: { activeIndex: browser.gZenWorkspaces.activeWorkspace },
|
||||
})
|
||||
);
|
||||
}
|
||||
await browser.gZenWorkspaces.workspaceBookmarks();
|
||||
workspaceList.innerHTML = '';
|
||||
workspaceList.parentNode.style.display = 'flex';
|
||||
@@ -2102,7 +2104,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
element,
|
||||
{
|
||||
transform: existingTransform ? [existingTransform, newTransform] : newTransform,
|
||||
paddingTop: existingTransform ? [existingPaddingTop, existingPaddingTop] : existingPaddingTop,
|
||||
paddingTop: existingTransform
|
||||
? [existingPaddingTop, existingPaddingTop]
|
||||
: existingPaddingTop,
|
||||
},
|
||||
{
|
||||
type: 'spring',
|
||||
@@ -2441,8 +2445,16 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
||||
tab.setAttribute('zen-workspace-id', workspace.uuid);
|
||||
}
|
||||
}
|
||||
window.dispatchEvent(
|
||||
new CustomEvent('ZenWorkspacesUIUpdate', {
|
||||
bubbles: true,
|
||||
detail: { activeIndex: workspace.uuid },
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
this.workspaceIcons.activeIndex = workspace.uuid;
|
||||
|
||||
setTimeout(gURLBar.formatValue.bind(gURLBar), 0);
|
||||
}
|
||||
|
||||
|
@@ -11,7 +11,9 @@
|
||||
align-items: center;
|
||||
display: flex;
|
||||
font-size: x-small;
|
||||
margin: 0 5px;
|
||||
padding: 0 3px;
|
||||
margin: 0;
|
||||
appearance: auto;
|
||||
|
||||
position: relative;
|
||||
|
||||
|
Reference in New Issue
Block a user