Skip to content

Commit 86ba3af

Browse files
Use svg icons only for the toolbar icons (#713)
1 parent 155be07 commit 86ba3af

File tree

6 files changed

+57
-6
lines changed

6 files changed

+57
-6
lines changed

packages/base/src/commands.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@ import {
3535
chamferIcon,
3636
filletIcon,
3737
wireframeIcon,
38-
transformIcon
38+
transformIcon,
39+
pencilSolidIcon,
40+
cameraSolidIcon
3941
} from './tools';
4042
import keybindings from './keybindings.json';
4143
import { DEFAULT_MESH_COLOR } from './3dview/helpers';
@@ -792,7 +794,7 @@ export function addCommands(
792794
});
793795
commands.addCommand(CommandIDs.newSketch, {
794796
label: trans.__('New Sketch'),
795-
iconClass: 'fa fa-pencil',
797+
icon: pencilSolidIcon,
796798
isEnabled: () => {
797799
return tracker.currentWidget
798800
? tracker.currentWidget.model.sharedModel.editable
@@ -1087,7 +1089,7 @@ export function addCommands(
10871089
commands.addCommand(CommandIDs.updateCameraSettings, {
10881090
label: trans.__('Camera Settings'),
10891091
isEnabled: () => Boolean(tracker.currentWidget),
1090-
iconClass: 'fa fa-camera',
1092+
icon: cameraSolidIcon,
10911093
execute: async () => {
10921094
const current = tracker.currentWidget;
10931095

packages/base/src/toolbar/widget.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
redoIcon,
66
Toolbar,
77
ReactiveToolbar,
8-
undoIcon,
9-
terminalIcon
8+
undoIcon
109
} from '@jupyterlab/ui-components';
1110
import { CommandRegistry } from '@lumino/commands';
1211
import { Widget } from '@lumino/widgets';
1312
import * as React from 'react';
1413

1514
import { CommandIDs } from '../commands';
1615
import { UsersItem } from './usertoolbaritem';
16+
import { terminalToolbarIcon } from '../tools';
1717

1818
export const TOOLBAR_SEPARATOR_CLASS = 'jcad-Toolbar-Separator';
1919

@@ -226,7 +226,7 @@ export class ToolbarWidget extends ReactiveToolbar {
226226
id: CommandIDs.toggleConsole,
227227
commands: options.commands,
228228
label: '',
229-
icon: terminalIcon
229+
icon: terminalToolbarIcon
230230
})
231231
);
232232

packages/base/src/tools.ts

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ import chamferIconStr from '../style/icon/chamfer.svg';
2424
import filletIconStr from '../style/icon/fillet.svg';
2525
import wireframeIconStr from '../style/icon/wireframe.svg';
2626
import chevronRightStr from '../style/icon/chevron-right.svg';
27+
import pencilSolidStr from '../style/icon/pencil-solid.svg';
28+
import cameraSolidStr from '../style/icon/camera-solid.svg';
29+
import terminalToolbarStr from '../style/icon/terminal-toolbar.svg';
2730

2831
import visibilitySvg from '../style/icon/visibility.svg';
2932
import visibilityOffSvg from '../style/icon/visibilityOff.svg';
@@ -136,11 +139,27 @@ export const wireframeIcon = new LabIcon({
136139
name: 'jupytercad:wireframe-icon',
137140
svgstr: wireframeIconStr
138141
});
142+
139143
export const chevronRightIcon = new LabIcon({
140144
name: 'jupytercad:chevron-right-icon',
141145
svgstr: chevronRightStr
142146
});
143147

148+
export const pencilSolidIcon = new LabIcon({
149+
name: 'jupytercad:pencil-solid-icon',
150+
svgstr: pencilSolidStr
151+
});
152+
153+
export const cameraSolidIcon = new LabIcon({
154+
name: 'jupytercad:camera-solid-icon',
155+
svgstr: cameraSolidStr
156+
});
157+
158+
export const terminalToolbarIcon = new LabIcon({
159+
name: 'jupytercad:terminal-toolbar-icon',
160+
svgstr: terminalToolbarStr
161+
});
162+
144163
export const debounce = (
145164
func: CallableFunction,
146165
timeout = 100
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 9 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)