Skip to content
This repository has been archived by the owner on Aug 31, 2021. It is now read-only.

Commit

Permalink
Add launcher button
Browse files Browse the repository at this point in the history
  • Loading branch information
martinRenou committed Apr 22, 2021
1 parent 5336067 commit cded903
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 1 deletion.
19 changes: 18 additions & 1 deletion src/filetree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,12 @@ import {
Toolbar,
ToolbarButton,
} from "@jupyterlab/apputils";
import { LabIcon, refreshIcon, newFolderIcon } from "@jupyterlab/ui-components";
import {
addIcon,
LabIcon,
refreshIcon,
newFolderIcon,
} from "@jupyterlab/ui-components";
import { PanelLayout, Widget } from "@lumino/widgets";
import { Uploader } from "./upload";
import {
Expand Down Expand Up @@ -823,6 +828,18 @@ export function constructFileTreeWidget(
selector: "div." + widget.id + " > table > *> .filetree-folder",
});

const launcher = new ToolbarButton({
actualOnClick: true,
icon: addIcon,
onClick: () => {
if (app.commands.hasCommand("launcher:create")) {
return app.commands.execute("launcher:create");
}
},
tooltip: "New Launcher",
});
widget.toolbar.addItem("new launcher", launcher);

const new_file = new ToolbarButton({
icon: newFolderIcon,
onClick: () => {
Expand Down
15 changes: 15 additions & 0 deletions style/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,21 @@
overflow: hidden;
white-space: nowrap;
}

.filetree-header.modified {
border-right: none;
}

.filetree-jupyterlab.jp-Toolbar
.jp-Toolbar-item:first-child
.jp-ToolbarButtonComponent {
width: 72px;
background: var(--jp-brand-color1);
}

.filetree-jupyterlab.jp-Toolbar
.jp-Toolbar-item:first-child
.jp-ToolbarButtonComponent
.jp-icon3 {
fill: white;
}

0 comments on commit cded903

Please sign in to comment.