Skip to content

Commit 1f58eed

Browse files
authored
Merge pull request #4 from ktaletsk/LabIcons
Migrate to LabIcon
2 parents ddc1bfd + 47bfce8 commit 1f58eed

20 files changed

+70
-107
lines changed

src/pdf.ts

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,15 @@ import {
2424

2525
import '../style/index.css';
2626

27+
import {
28+
downloadIcon,
29+
fitIcon,
30+
nextIcon,
31+
previousIcon,
32+
zoomInIcon,
33+
zoomOutIcon
34+
} from './style/icons';
35+
2736
import { PageNumberWidget } from './pagenumber';
2837

2938
/**
@@ -484,7 +493,7 @@ namespace Private {
484493
toolbar.addItem(
485494
'previous',
486495
new ToolbarButton({
487-
iconClass: 'jp-PreviousIcon jp-Icon jp-Icon-16',
496+
icon: previousIcon,
488497
onClick: () => {
489498
if (!content.viewer) {
490499
return;
@@ -500,7 +509,7 @@ namespace Private {
500509
toolbar.addItem(
501510
'next',
502511
new ToolbarButton({
503-
iconClass: 'jp-NextIcon jp-Icon jp-Icon-16',
512+
icon: nextIcon,
504513
onClick: () => {
505514
if (!content.viewer) {
506515
return;
@@ -521,7 +530,7 @@ namespace Private {
521530
toolbar.addItem(
522531
'zoomOut',
523532
new ToolbarButton({
524-
iconClass: 'jp-ZoomOutIcon jp-Icon jp-Icon-16',
533+
icon: zoomOutIcon,
525534
onClick: () => {
526535
if (!content.viewer) {
527536
return;
@@ -540,7 +549,7 @@ namespace Private {
540549
toolbar.addItem(
541550
'zoomIn',
542551
new ToolbarButton({
543-
iconClass: 'jp-ZoomInIcon jp-Icon jp-Icon-16',
552+
icon: zoomInIcon,
544553
onClick: () => {
545554
if (!content.viewer) {
546555
return;
@@ -560,7 +569,7 @@ namespace Private {
560569
toolbar.addItem(
561570
'fit',
562571
new ToolbarButton({
563-
iconClass: 'jp-FitIcon jp-Icon jp-Icon-16',
572+
icon: fitIcon,
564573
onClick: () => {
565574
if (!content.viewer) {
566575
return;
@@ -574,7 +583,7 @@ namespace Private {
574583
toolbar.addItem(
575584
'download',
576585
new ToolbarButton({
577-
iconClass: 'jp-DownloadIcon jp-Icon jp-Icon-16',
586+
icon: downloadIcon,
578587
onClick: () => {
579588
if (!content.viewer) {
580589
return;

src/style/icons.ts

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { LabIcon } from '@jupyterlab/ui-components';
2+
3+
import downloadSvg from '../../style/icons/download.svg';
4+
import fitSvg from '../../style/icons/fit.svg';
5+
import nextSvg from '../../style/icons/next.svg';
6+
import previousSvg from '../../style/icons/previous.svg';
7+
import zoomInSvg from '../../style/icons/zoom_in.svg';
8+
import zoomOutSvg from '../../style/icons/zoom_out.svg';
9+
10+
export const downloadIcon = new LabIcon({
11+
name: 'latex:download',
12+
svgstr: downloadSvg
13+
});
14+
export const fitIcon = new LabIcon({
15+
name: 'latex:fit',
16+
svgstr: fitSvg
17+
});
18+
export const nextIcon = new LabIcon({
19+
name: 'latex:next',
20+
svgstr: nextSvg
21+
});
22+
export const previousIcon = new LabIcon({
23+
name: 'latex:previous',
24+
svgstr: previousSvg
25+
});
26+
export const zoomInIcon = new LabIcon({
27+
name: 'latex:zoom-in',
28+
svgstr: zoomInSvg
29+
});
30+
export const zoomOutIcon = new LabIcon({
31+
name: 'latex:zoom-out',
32+
svgstr: zoomOutSvg
33+
});

style/download_dark.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

style/download_light.svg

Lines changed: 0 additions & 4 deletions
This file was deleted.

style/fit_light.svg

Lines changed: 0 additions & 10 deletions
This file was deleted.

style/icons/download.svg

Lines changed: 4 additions & 0 deletions
Loading

style/fit_dark.svg renamed to style/icons/fit.svg

Lines changed: 1 addition & 1 deletion
Loading

style/icons/next.svg

Lines changed: 4 additions & 0 deletions
Loading

style/icons/previous.svg

Lines changed: 4 additions & 0 deletions
Loading

style/icons/zoom_in.svg

Lines changed: 5 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)