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));
|
window.addEventListener('TabClose', this.onTabClose.bind(this));
|
||||||
this.tabsWrapper.addEventListener('scroll', this.saveScrollbarState.bind(this));
|
|
||||||
|
|
||||||
gZenMediaController.init();
|
gZenMediaController.init();
|
||||||
},
|
},
|
||||||
|
@@ -181,7 +181,11 @@ export class ZenThemeMarketplaceParent extends JSWindowActorParent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async installTheme(theme) {
|
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() {
|
async checkForThemeChanges() {
|
||||||
|
@@ -51,22 +51,25 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
on_ZenWorkspacesUIUpdate(event) {
|
async on_ZenWorkspacesUIUpdate(event) {
|
||||||
this.#updateIcons();
|
await this.#updateIcons();
|
||||||
this.activeIndex = event.detail.activeIndex;
|
this.activeIndex = event.detail.activeIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
set activeIndex(uuid) {
|
set activeIndex(uuid) {
|
||||||
const buttons = this.querySelectorAll('toolbarbutton');
|
const buttons = this.querySelectorAll('toolbarbutton');
|
||||||
|
if (!buttons.length) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
let i = 0;
|
let i = 0;
|
||||||
let selected = 0;
|
let selected = -1;
|
||||||
for (const button of buttons) {
|
for (const button of buttons) {
|
||||||
if (button.getAttribute('zen-workspace-id') == uuid) {
|
if (button.getAttribute('zen-workspace-id') == uuid) {
|
||||||
selected = i;
|
selected = i;
|
||||||
} else {
|
} else {
|
||||||
button.removeAttribute('active');
|
button.removeAttribute('active');
|
||||||
}
|
}
|
||||||
selected++;
|
i++;
|
||||||
}
|
}
|
||||||
buttons[selected].setAttribute('active', true);
|
buttons[selected].setAttribute('active', true);
|
||||||
this.setAttribute('selected', selected);
|
this.setAttribute('selected', selected);
|
||||||
|
@@ -1594,12 +1594,14 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
browser.gZenWorkspaces._workspaceBookmarksCache = null;
|
browser.gZenWorkspaces._workspaceBookmarksCache = null;
|
||||||
}
|
}
|
||||||
let workspaces = await browser.gZenWorkspaces._workspaces();
|
let workspaces = await browser.gZenWorkspaces._workspaces();
|
||||||
browser.dispatchEvent(
|
if (clearCache) {
|
||||||
new CustomEvent('ZenWorkspacesUIUpdate', {
|
browser.dispatchEvent(
|
||||||
bubbles: true,
|
new CustomEvent('ZenWorkspacesUIUpdate', {
|
||||||
detail: { workspaces, activeIndex: browser.gZenWorkspaces.activeWorkspace },
|
bubbles: true,
|
||||||
})
|
detail: { activeIndex: browser.gZenWorkspaces.activeWorkspace },
|
||||||
);
|
})
|
||||||
|
);
|
||||||
|
}
|
||||||
await browser.gZenWorkspaces.workspaceBookmarks();
|
await browser.gZenWorkspaces.workspaceBookmarks();
|
||||||
workspaceList.innerHTML = '';
|
workspaceList.innerHTML = '';
|
||||||
workspaceList.parentNode.style.display = 'flex';
|
workspaceList.parentNode.style.display = 'flex';
|
||||||
@@ -2102,7 +2104,9 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
element,
|
element,
|
||||||
{
|
{
|
||||||
transform: existingTransform ? [existingTransform, newTransform] : newTransform,
|
transform: existingTransform ? [existingTransform, newTransform] : newTransform,
|
||||||
paddingTop: existingTransform ? [existingPaddingTop, existingPaddingTop] : existingPaddingTop,
|
paddingTop: existingTransform
|
||||||
|
? [existingPaddingTop, existingPaddingTop]
|
||||||
|
: existingPaddingTop,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: 'spring',
|
type: 'spring',
|
||||||
@@ -2441,8 +2445,16 @@ var gZenWorkspaces = new (class extends ZenMultiWindowFeature {
|
|||||||
tab.setAttribute('zen-workspace-id', workspace.uuid);
|
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);
|
setTimeout(gURLBar.formatValue.bind(gURLBar), 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -11,7 +11,9 @@
|
|||||||
align-items: center;
|
align-items: center;
|
||||||
display: flex;
|
display: flex;
|
||||||
font-size: x-small;
|
font-size: x-small;
|
||||||
margin: 0 5px;
|
padding: 0 3px;
|
||||||
|
margin: 0;
|
||||||
|
appearance: auto;
|
||||||
|
|
||||||
position: relative;
|
position: relative;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user