Skip to content

Commit 0b75795

Browse files
committed
new icon fixes jupyter-server#3
1 parent f8831be commit 0b75795

File tree

4 files changed

+39
-5
lines changed

4 files changed

+39
-5
lines changed

src/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ import {
33
JupyterFrontEndPlugin
44
} from '@jupyterlab/application';
55
import { INotebookTracker } from '@jupyterlab/notebook';
6+
import { LabIcon } from '@jupyterlab/ui-components';
67
import { ICommandPalette } from '@jupyterlab/apputils';
78
import { ILauncher } from '@jupyterlab/launcher';
8-
import { jupyterIcon as icon } from '@jupyterlab/ui-components';
99
import { KernelUsagePanel } from './panel';
10+
import tachometer from '../style/tachometer.svg';
1011

1112
namespace CommandIDs {
1213
export const getKernelUsage = 'kernel-usage:get';
@@ -41,7 +42,10 @@ const plugin: JupyterFrontEndPlugin<void> = {
4142
commands.addCommand(CommandIDs.getKernelUsage, {
4243
label: 'Kernel Usage',
4344
caption: 'Kernel Usage',
44-
icon: icon,
45+
icon: new LabIcon({
46+
name: 'jupyterlab-kernel-usage:icon',
47+
svgstr: tachometer
48+
}),
4549
execute: createPanel
4650
});
4751

src/panel.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { Message } from '@lumino/messaging';
22
import { ISignal } from '@lumino/signaling';
33
import { StackedPanel } from '@lumino/widgets';
4-
import { KernelUsageWidget } from './widget';
5-
import { jupyterIcon as icon } from '@jupyterlab/ui-components';
4+
import { LabIcon } from '@jupyterlab/ui-components';
65
import { INotebookTracker, NotebookPanel } from '@jupyterlab/notebook';
6+
import { KernelUsageWidget } from './widget';
7+
import tachometer from '../style/tachometer.svg';
78

89
const PANEL_CLASS = 'jp-kernelusage-view';
910

@@ -16,7 +17,10 @@ export class KernelUsagePanel extends StackedPanel {
1617
this.addClass(PANEL_CLASS);
1718
this.id = 'kernelusage-panel-id';
1819
this.title.caption = 'Kernel Usage';
19-
this.title.icon = icon;
20+
this.title.icon = new LabIcon({
21+
name: 'jupyterlab-kernel-usage:icon',
22+
svgstr: tachometer
23+
});
2024
this.title.closable = true;
2125
const widget = new KernelUsageWidget({
2226
widgetAdded: props.widgetAdded,

src/svg.d.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
declare module '*.svg' {
2+
const value: string;
3+
export default value;
4+
}

style/tachometer.svg

Lines changed: 22 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)