Ver código fonte

migrated all refs to deprecated title.iconRenderer => title.icon

telamonian 5 anos atrás
pai
commit
af6053e8ff

+ 1 - 1
packages/application-extension/src/index.tsx

@@ -825,7 +825,7 @@ const propertyInspector: JupyterFrontEndPlugin<IPropertyInspectorProvider> = {
   provides: IPropertyInspectorProvider,
   activate: (app: JupyterFrontEnd, labshell: ILabShell) => {
     const widget = new SideBarPropertyInspectorProvider(labshell);
-    widget.title.iconRenderer = buildIcon;
+    widget.title.icon = buildIcon;
     widget.title.caption = 'Property Inspector';
     widget.id = 'jp-property-inspector';
     labshell.add(widget, 'left');

+ 4 - 4
packages/application/src/shell.ts

@@ -772,8 +772,8 @@ export class LabShell extends Widget implements JupyterFrontEnd.IShell {
     // (for context menu support)
     title.dataset = { ...title.dataset, id: widget.id };
 
-    // set an appropriate style class for the iconRenderer
-    if (title.iconRenderer) {
+    // set an appropriate style class for the icon
+    if (title.icon && typeof title.icon !== 'string') {
       title.iconClass = LabIcon.UNSTABLE_style({
         className: title.iconClass,
         justify: 'center',
@@ -1184,8 +1184,8 @@ namespace Private {
       // in order to dispatch click events to the right widget.
       title.dataset = { id: widget.id };
 
-      // set an appropriate style class for the iconRenderer
-      if (title.iconRenderer) {
+      // set an appropriate style class for the icon
+      if (title.icon && typeof title.icon !== 'string') {
         title.iconClass = LabIcon.UNSTABLE_style({
           className: title.iconClass,
           justify: 'center',

+ 2 - 2
packages/apputils-extension/src/palette.ts

@@ -29,7 +29,7 @@ export class Palette implements ICommandPalette {
    */
   constructor(palette: CommandPalette) {
     this._palette = palette;
-    this._palette.title.iconRenderer = paletteIcon;
+    this._palette.title.icon = paletteIcon;
     this._palette.title.label = '';
     this._palette.title.caption = 'Command Palette';
   }
@@ -143,7 +143,7 @@ namespace Private {
     if (!palette) {
       palette = new CommandPalette({ commands: app.commands });
       palette.id = 'command-palette';
-      palette.title.iconRenderer = paletteIcon;
+      palette.title.icon = paletteIcon;
       palette.title.label = 'Commands';
     }
 

+ 2 - 2
packages/apputils/src/mainareawidget.ts

@@ -177,9 +177,9 @@ export class MainAreaWidget<T extends Widget = Widget> extends Widget
     const content = this.content;
     this.title.label = content.title.label;
     this.title.mnemonic = content.title.mnemonic;
+    this.title.icon = content.title.icon;
     this.title.iconClass = content.title.iconClass;
     this.title.iconLabel = content.title.iconLabel;
-    this.title.iconRenderer = content.title.iconRenderer;
     this.title.caption = content.title.caption;
     this.title.className = content.title.className;
     this.title.dataset = content.title.dataset;
@@ -197,9 +197,9 @@ export class MainAreaWidget<T extends Widget = Widget> extends Widget
     const content = this.content;
     content.title.label = this.title.label;
     content.title.mnemonic = this.title.mnemonic;
+    content.title.icon = this.title.icon;
     content.title.iconClass = this.title.iconClass;
     content.title.iconLabel = this.title.iconLabel;
-    content.title.iconRenderer = this.title.iconRenderer;
     content.title.caption = this.title.caption;
     content.title.className = this.title.className;
     content.title.dataset = this.title.dataset;

+ 1 - 1
packages/console/src/panel.ts

@@ -92,7 +92,7 @@ export class ConsolePanel extends MainAreaWidget<Panel> {
     sessionContext.kernelChanged.connect(this._updateTitlePanel, this);
     sessionContext.propertyChanged.connect(this._updateTitlePanel, this);
 
-    this.title.iconRenderer = consoleIcon;
+    this.title.icon = consoleIcon;
     this.title.closable = true;
     this.id = `console-${count}`;
   }

+ 2 - 2
packages/csvviewer-extension/src/index.ts

@@ -128,9 +128,9 @@ function activateCsv(
     });
 
     if (ft) {
+      widget.title.icon = ft.icon!;
       widget.title.iconClass = ft.iconClass!;
       widget.title.iconLabel = ft.iconLabel!;
-      widget.title.iconRenderer = ft.icon!;
     }
     // Set the theme for the new widget.
     widget.content.style = style;
@@ -208,9 +208,9 @@ function activateTsv(
     });
 
     if (ft) {
+      widget.title.icon = ft.icon!;
       widget.title.iconClass = ft.iconClass!;
       widget.title.iconLabel = ft.iconLabel!;
-      widget.title.iconRenderer = ft.icon!;
     }
     // Set the theme for the new widget.
     widget.content.style = style;

+ 1 - 1
packages/docregistry/src/mimedocument.ts

@@ -287,9 +287,9 @@ export class MimeDocumentFactory extends ABCWidgetFactory<MimeDocument> {
       dataType: this._dataType
     });
 
+    content.title.icon = ft?.icon!;
     content.title.iconClass = ft?.iconClass ?? '';
     content.title.iconLabel = ft?.iconLabel ?? '';
-    content.title.iconRenderer = ft?.icon!;
 
     const widget = new MimeDocument({ content, context });
 

+ 1 - 1
packages/extensionmanager-extension/src/index.ts

@@ -45,7 +45,7 @@ const plugin: JupyterFrontEndPlugin<void> = {
     const createView = () => {
       const v = new ExtensionView(serviceManager);
       v.id = 'extensionmanager.main-view';
-      v.title.iconRenderer = extensionIcon;
+      v.title.icon = extensionIcon;
       v.title.caption = 'Extension Manager';
       if (restorer) {
         restorer.add(v, v.id);

+ 1 - 1
packages/filebrowser-extension/src/index.ts

@@ -308,7 +308,7 @@ function activateBrowser(
     mainMenu
   );
 
-  browser.title.iconRenderer = folderIcon;
+  browser.title.icon = folderIcon;
   // Show the current file browser shortcut in its title.
   const updateBrowserTitle = () => {
     const binding = find(

+ 1 - 1
packages/fileeditor/src/widget.ts

@@ -326,7 +326,7 @@ export class FileEditorFactory extends ABCWidgetFactory<
       mimeTypeService: this._services.mimeTypeService
     });
 
-    content.title.iconRenderer = textEditorIcon;
+    content.title.icon = textEditorIcon;
 
     const widget = new DocumentWidget({ content, context });
     return widget;

+ 1 - 1
packages/htmlviewer-extension/src/index.tsx

@@ -95,9 +95,9 @@ function activateHTMLViewer(
       app.commands.notifyCommandChanged(CommandIDs.trustHTML);
     });
 
+    widget.title.icon = ft.icon!;
     widget.title.iconClass = ft.iconClass ?? '';
     widget.title.iconLabel = ft.iconLabel ?? '';
-    widget.title.iconRenderer = ft.icon!;
   });
 
   // Add a command to trust the active HTML document,

+ 1 - 1
packages/imageviewer-extension/src/index.ts

@@ -105,9 +105,9 @@ function activate(
     const types = app.docRegistry.getFileTypesForPath(widget.context.path);
 
     if (types.length > 0) {
+      widget.title.icon = types[0].icon!;
       widget.title.iconClass = types[0].iconClass ?? '';
       widget.title.iconLabel = types[0].iconLabel ?? '';
-      widget.title.iconRenderer = types[0].icon!;
     }
   });
 

+ 1 - 1
packages/launcher-extension/src/index.ts

@@ -60,8 +60,8 @@ function activate(
       const launcher = new Launcher({ model, cwd, callback, commands });
 
       launcher.model = model;
+      launcher.title.icon = launcherIcon;
       launcher.title.label = 'Launcher';
-      launcher.title.iconRenderer = launcherIcon;
 
       let main = new MainAreaWidget({ content: launcher });
 

+ 1 - 1
packages/logconsole-extension/src/index.tsx

@@ -144,8 +144,8 @@ function activateLogConsole(
     logConsoleWidget = new MainAreaWidget({ content: logConsolePanel });
     logConsoleWidget.addClass('jp-LogConsole');
     logConsoleWidget.title.closable = true;
+    logConsoleWidget.title.icon = listIcon;
     logConsoleWidget.title.label = 'Log Console';
-    logConsoleWidget.title.iconRenderer = listIcon;
 
     const addCheckpointButton = new CommandToolbarButton({
       commands: app.commands,

+ 1 - 1
packages/markdownviewer/src/widget.ts

@@ -309,9 +309,9 @@ export class MarkdownViewerFactory extends ABCWidgetFactory<MarkdownDocument> {
     });
     const renderer = rendermime.createRenderer(MIMETYPE);
     const content = new MarkdownViewer({ context, renderer });
+    content.title.icon = this._fileType?.icon!;
     content.title.iconClass = this._fileType?.iconClass ?? '';
     content.title.iconLabel = this._fileType?.iconLabel ?? '';
-    content.title.iconRenderer = this._fileType?.icon!;
     const widget = new MarkdownDocument({ content, context });
 
     return widget;

+ 1 - 1
packages/running-extension/src/index.ts

@@ -49,8 +49,8 @@ function activate(
   let runningSessionManagers = new RunningSessionManagers();
   let running = new RunningSessions(runningSessionManagers);
   running.id = 'jp-running-sessions';
-  running.title.iconRenderer = runningIcon;
   running.title.caption = 'Running Terminals and Kernels';
+  running.title.icon = runningIcon;
 
   // Let the application restorer track the running panel for restoration of
   // application state (e.g. setting the running panel as the current side bar

+ 1 - 1
packages/settingeditor-extension/src/index.ts

@@ -132,8 +132,8 @@ function activate(
       });
 
       editor.id = namespace;
+      editor.title.icon = settingsIcon;
       editor.title.label = 'Settings';
-      editor.title.iconRenderer = settingsIcon;
 
       let main = new MainAreaWidget({ content: editor });
       void tracker.add(main);

+ 1 - 1
packages/tabmanager-extension/src/index.ts

@@ -31,8 +31,8 @@ const plugin: JupyterFrontEndPlugin<void> = {
     }
 
     tabs.id = 'tab-manager';
-    tabs.title.iconRenderer = tabIcon;
     tabs.title.caption = 'Open Tabs';
+    tabs.title.icon = tabIcon;
     header.textContent = 'Open Tabs';
     tabs.node.insertBefore(header, tabs.contentNode);
     shell.add(tabs, 'left', { rank: 600 });