Skip to content

Commit 16cfba8

Browse files
IsabelParedeso314pre-commit-ci[bot]martinRenou
authored
Add stl and stp icons (#591)
* Add stl and stp icons Co-authored-by: Olivier MATHIEU <[email protected]> * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Make use of the new icons * Icons in tabs * Selectable icons --------- Co-authored-by: Olivier MATHIEU <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: martinRenou <[email protected]>
1 parent ad389b2 commit 16cfba8

File tree

5 files changed

+50
-4
lines changed

5 files changed

+50
-4
lines changed

packages/base/src/tools.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ import { LabIcon } from '@jupyterlab/ui-components';
44
import * as d3Color from 'd3-color';
55

66
import logoStr from '../style/icon/logo.svg';
7+
import stlStr from '../style/icon/stl.svg';
8+
import stpStr from '../style/icon/stp.svg';
79
import axesIconStr from '../style/icon/axes.svg';
810
import boxIconStr from '../style/icon/box.svg';
911
import coneIconStr from '../style/icon/cone.svg';
@@ -38,6 +40,16 @@ export const logoIcon = new LabIcon({
3840
svgstr: logoStr
3941
});
4042

43+
export const stlIcon = new LabIcon({
44+
name: 'jupytercad:stl',
45+
svgstr: stlStr
46+
});
47+
48+
export const stpIcon = new LabIcon({
49+
name: 'jupytercad:stp',
50+
svgstr: stpStr
51+
});
52+
4153
export const minimizeIcon = new LabIcon({
4254
name: 'jupytercad:minimize-icon',
4355
svgstr: minimizeIconStr

packages/base/style/icon/stl.svg

Lines changed: 16 additions & 0 deletions
Loading

packages/base/style/icon/stp.svg

Lines changed: 16 additions & 0 deletions
Loading

python/jupytercad_core/src/stepplugin/plugins.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IThemeManager, WidgetTracker } from '@jupyterlab/apputils';
1919
import { JupyterCadStepModelFactory } from './modelfactory';
2020
import { JupyterCadWidgetFactory } from '../factory';
2121
import { JupyterCadStepDoc } from './model';
22-
import { logoIcon } from '@jupytercad/base';
22+
import { stpIcon } from '@jupytercad/base';
2323

2424
const FACTORY = 'JupyterCAD STEP Viewer';
2525

@@ -55,7 +55,7 @@ const activate = (
5555
extensions: ['.step', '.STEP'],
5656
fileFormat: 'text',
5757
contentType: 'step',
58-
icon: logoIcon
58+
icon: stpIcon
5959
});
6060

6161
const stepSharedModelFactory: SharedDocumentFactory = () => {
@@ -69,6 +69,7 @@ const activate = (
6969
}
7070

7171
widgetFactory.widgetCreated.connect((sender, widget) => {
72+
widget.title.icon = stpIcon;
7273
widget.context.pathChanged.connect(() => {
7374
tracker.save(widget);
7475
});

python/jupytercad_core/src/stlplugin/plugins.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ import { IThemeManager, WidgetTracker } from '@jupyterlab/apputils';
1919
import { JupyterCadStlModelFactory } from './modelfactory';
2020
import { JupyterCadWidgetFactory } from '../factory';
2121
import { JupyterCadStlDoc } from './model';
22-
import { logoIcon } from '@jupytercad/base';
22+
import { stlIcon } from '@jupytercad/base';
2323

2424
const FACTORY = 'JupyterCAD STL Viewer';
2525

@@ -55,7 +55,7 @@ const activate = (
5555
extensions: ['.stl', '.STL'],
5656
fileFormat: 'text',
5757
contentType: 'stl',
58-
icon: logoIcon
58+
icon: stlIcon
5959
});
6060

6161
const stlSharedModelFactory: SharedDocumentFactory = () => {
@@ -69,6 +69,7 @@ const activate = (
6969
}
7070

7171
widgetFactory.widgetCreated.connect((sender, widget) => {
72+
widget.title.icon = stlIcon;
7273
widget.context.pathChanged.connect(() => {
7374
tracker.save(widget);
7475
});

0 commit comments

Comments
 (0)