Skip to content

Commit a5a942c

Browse files
committed
Change the tab renderer to allow adding closable tab
1 parent 22fedf4 commit a5a942c

File tree

1 file changed

+16
-11
lines changed

1 file changed

+16
-11
lines changed

packages/tree-extension/src/index.ts

+16-11
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33

44
import {
55
JupyterFrontEnd,
6-
JupyterFrontEndPlugin
6+
JupyterFrontEndPlugin,
77
} from '@jupyterlab/application';
88

99
import {
1010
IToolbarWidgetRegistry,
1111
createToolbarFactory,
12-
setToolbar
12+
setToolbar,
1313
} from '@jupyterlab/apputils';
1414

1515
import {
1616
IFileBrowserFactory,
1717
FileBrowser,
18-
Uploader
18+
Uploader,
1919
} from '@jupyterlab/filebrowser';
2020

2121
import { ISettingRegistry } from '@jupyterlab/settingregistry';
@@ -27,7 +27,8 @@ import { ITranslator } from '@jupyterlab/translation';
2727
import {
2828
caretDownIcon,
2929
folderIcon,
30-
runningIcon
30+
runningIcon,
31+
TabBarSvg,
3132
} from '@jupyterlab/ui-components';
3233

3334
import { Menu, MenuBar, TabPanel } from '@lumino/widgets';
@@ -70,10 +71,10 @@ const createNew: JupyterFrontEndPlugin<void> = {
7071
'terminal:create-new',
7172
'console:create',
7273
'filebrowser:create-new-file',
73-
'filebrowser:create-new-directory'
74+
'filebrowser:create-new-directory',
7475
];
7576

76-
newCommands.forEach(command => {
77+
newCommands.forEach((command) => {
7778
newMenu.addItem({ command });
7879
});
7980

@@ -89,7 +90,7 @@ const createNew: JupyterFrontEndPlugin<void> = {
8990
}
9091
);
9192
}
92-
}
93+
},
9394
};
9495

9596
/**
@@ -101,7 +102,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
101102
IFileBrowserFactory,
102103
ITranslator,
103104
ISettingRegistry,
104-
IToolbarWidgetRegistry
105+
IToolbarWidgetRegistry,
105106
],
106107
optional: [IRunningSessionManagers],
107108
autoStart: true,
@@ -113,7 +114,11 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
113114
toolbarRegistry: IToolbarWidgetRegistry,
114115
manager: IRunningSessionManagers | null
115116
): void => {
116-
const tabPanel = new TabPanel({ tabPlacement: 'top', tabsMovable: true });
117+
const tabPanel = new TabPanel({
118+
tabPlacement: 'top',
119+
tabsMovable: true,
120+
renderer: TabBarSvg.defaultRenderer,
121+
});
117122
tabPanel.addClass('jp-TreePanel');
118123

119124
const trans = translator.load('notebook');
@@ -135,7 +140,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
135140
new Uploader({
136141
model: browser.model,
137142
translator,
138-
label: trans.__('Upload')
143+
label: trans.__('Upload'),
139144
})
140145
);
141146

@@ -173,7 +178,7 @@ const browserWidget: JupyterFrontEndPlugin<void> = {
173178
});
174179

175180
app.shell.add(tabPanel, 'main', { rank: 100 });
176-
}
181+
},
177182
};
178183

179184
/**

0 commit comments

Comments
 (0)