diff --git a/packages/celltags/src/addwidget.ts b/packages/celltags/src/addwidget.ts index a8ae0e6b9dcc..167d199cdad6 100644 --- a/packages/celltags/src/addwidget.ts +++ b/packages/celltags/src/addwidget.ts @@ -1,6 +1,6 @@ import { Widget } from '@lumino/widgets'; -import { defaultIconRegistry } from '@jupyterlab/ui-components'; +import { addIcon } from '@jupyterlab/ui-components'; import { TagTool } from './tool'; @@ -31,18 +31,16 @@ export class AddWidget extends Widget { let tag = document.createElement('div'); tag.className = 'tag-holder'; tag.appendChild(text); - let img = document.createElement('span'); - defaultIconRegistry.icon({ - name: 'add', - container: img, + let iconContainer = addIcon.element({ + tag: 'span', center: true, height: '18px', width: '18px', - marginLeft: '3px', + marginLeft: '3px',s marginRight: '-5px' }); this.addClass('unapplied-tag'); - tag.appendChild(img); + tag.appendChild(iconContainer); this.node.appendChild(tag); } diff --git a/packages/celltags/src/widget.ts b/packages/celltags/src/widget.ts index 1f8709933c43..5ce0327229da 100644 --- a/packages/celltags/src/widget.ts +++ b/packages/celltags/src/widget.ts @@ -1,6 +1,6 @@ import { Widget } from '@lumino/widgets'; -import { defaultIconRegistry } from '@jupyterlab/ui-components'; +import { checkIcon } from '@jupyterlab/ui-components'; import { TagTool } from './tool'; @@ -29,10 +29,8 @@ export class TagWidget extends Widget { let tag = document.createElement('div'); tag.className = 'tag-holder'; tag.appendChild(text); - let img = document.createElement('span'); - defaultIconRegistry.icon({ - name: 'check', - container: img, + let iconContainer = checkIcon.element({ + tag: 'span', center: true, height: '18px', width: '18px', @@ -43,9 +41,9 @@ export class TagWidget extends Widget { this.addClass('applied-tag'); } else { this.addClass('unapplied-tag'); - img.style.display = 'none'; + iconContainer.style.display = 'none'; } - tag.appendChild(img); + tag.appendChild(iconContainer); this.node.appendChild(tag); } diff --git a/packages/filebrowser/src/listing.ts b/packages/filebrowser/src/listing.ts index 0cc34a72c9ce..3db7acabd072 100644 --- a/packages/filebrowser/src/listing.ts +++ b/packages/filebrowser/src/listing.ts @@ -1812,20 +1812,21 @@ export namespace DirListing { const text = DOMUtils.findElement(node, ITEM_TEXT_CLASS); const modified = DOMUtils.findElement(node, ITEM_MODIFIED_CLASS); - let icon = fileType?.iconRenderer - ? fileType.iconRenderer - : fileType?.iconClass - ? JLIcon.get(fileType.iconClass) - : fileIcon; - let iconClass = classes(ITEM_ICON_CLASS, fileType?.iconClass); - - // render the icon svg node - icon.element({ - className: iconClass, + const iconProps: JLIcon.IProps = { + className: ITEM_ICON_CLASS, container: iconContainer, center: true, kind: 'listing' - }); + }; + + // render the icon svg node + if (fileType?.iconRenderer) { + fileType.iconRenderer.element(iconProps); + } else if (fileType?.iconClass) { + JLIcon.getElement({name: fileType.iconClass, ...iconProps}); + } else { + fileIcon.element(iconProps); + } let hoverText = 'Name: ' + model.name; // add file size to pop up if its available diff --git a/packages/settingeditor/src/pluginlist.tsx b/packages/settingeditor/src/pluginlist.tsx index 88dd441ab43b..47700d570088 100644 --- a/packages/settingeditor/src/pluginlist.tsx +++ b/packages/settingeditor/src/pluginlist.tsx @@ -261,7 +261,6 @@ namespace Private { const itemTitle = `${schema.description}\n${id}\n${version}`; const iconClass = getHint(ICON_CLASS_KEY, registry, plugin); const iconTitle = getHint(ICON_LABEL_KEY, registry, plugin); - const icon = JLIcon.get(iconClass, settingsIcon); return (