diff --git a/src/ZenWorkspaces.mjs b/src/ZenWorkspaces.mjs index aa2f837..ba509cc 100644 --- a/src/ZenWorkspaces.mjs +++ b/src/ZenWorkspaces.mjs @@ -100,7 +100,9 @@ var ZenWorkspaces = { } }, - _kIcons: JSON.parse(Services.prefs.getStringPref("zen.workspaces.icons")), + // Convert all the icons to just the first character, just in case someone + // decides to use a string with more than one character + _kIcons: JSON.parse(Services.prefs.getStringPref("zen.workspaces.icons")).map((icon) => icon[0]), _initializeWorkspaceCreationIcons() { let container = document.getElementById('PanelUI-zen-workspaces-create-icons-container'); @@ -231,12 +233,31 @@ var ZenWorkspaces = { element.className = 'subviewbutton'; element.setAttribute('tooltiptext', workspace.name); element.setAttribute('zen-workspace-id', workspace.uuid); - //element.setAttribute("context", "zenWorkspaceActionsMenu"); + if (workspace.used) { + element.setAttribute('active', 'true'); + } + if (workspace.default) { + element.setAttribute('default', 'true'); + } + console.log(ContextualIdentityService.getPublicIdentities()) + console.log(workspace) + const containerGroup = ContextualIdentityService.getPublicIdentities().find( + (container) => container.userContextId === workspace.containerTabId + ); + console.log(containerGroup) + if (containerGroup) { + element.classList.add("identity-color-" + containerGroup.color); + element.setAttribute("data-usercontextid", containerGroup.userContextId); + } let childs = window.MozXULElement.parseXULToFragment(`
-