Browse Source

Add icon for .jl files in explorer (#10397)

* Add icon for .jl files in explorer

* Add Julia icon to file menu option
Shashank Gupta 3 years ago
parent
commit
35efc25abe

+ 8 - 0
packages/docregistry/src/registry.ts

@@ -17,6 +17,7 @@ import {
   folderIcon,
   imageIcon,
   jsonIcon,
+  juliaIcon,
   LabIcon,
   markdownIcon,
   notebookIcon,
@@ -1392,6 +1393,13 @@ export namespace DocumentRegistry {
         mimeTypes: ['application/json'],
         icon: jsonIcon
       },
+      {
+        name: 'julia',
+        displayName: trans.__('Julia File'),
+        extensions: ['.jl'],
+        mimeTypes: ['text/x-julia'],
+        icon: juliaIcon
+      },
       {
         name: 'csv',
         displayName: trans.__('CSV File'),

+ 1 - 1
packages/fileeditor-extension/src/index.ts

@@ -194,7 +194,7 @@ function activate(
       [
         {
           fileExt: 'jl',
-          iconName: 'ui-components:text-editor',
+          iconName: 'ui-components:julia',
           launcherLabel: trans.__('Julia File'),
           paletteLabel: trans.__('New Julia File'),
           caption: trans.__('Create a new Julia file')

+ 2 - 0
packages/ui-components/src/icon/iconimports.ts

@@ -42,6 +42,7 @@ import html5Svgstr from '../../style/icons/filetype/html5.svg';
 import imageSvgstr from '../../style/icons/filetype/image.svg';
 import inspectorSvgstr from '../../style/icons/filetype/inspector.svg';
 import jsonSvgstr from '../../style/icons/filetype/json.svg';
+import juliaSvgstr from '../../style/icons/filetype/julia.svg';
 import jupyterFaviconSvgstr from '../../style/icons/jupyter/jupyter-favicon.svg';
 import jupyterSvgstr from '../../style/icons/jupyter/jupyter.svg';
 import jupyterlabWordmarkSvgstr from '../../style/icons/jupyter/jupyterlab-wordmark.svg';
@@ -121,6 +122,7 @@ export const html5Icon = new LabIcon({ name: 'ui-components:html5', svgstr: html
 export const imageIcon = new LabIcon({ name: 'ui-components:image', svgstr: imageSvgstr });
 export const inspectorIcon = new LabIcon({ name: 'ui-components:inspector', svgstr: inspectorSvgstr });
 export const jsonIcon = new LabIcon({ name: 'ui-components:json', svgstr: jsonSvgstr });
+export const juliaIcon = new LabIcon({ name: 'ui-components:julia', svgstr: juliaSvgstr });
 export const jupyterFaviconIcon = new LabIcon({ name: 'ui-components:jupyter-favicon', svgstr: jupyterFaviconSvgstr });
 export const jupyterIcon = new LabIcon({ name: 'ui-components:jupyter', svgstr: jupyterSvgstr });
 export const jupyterlabWordmarkIcon = new LabIcon({ name: 'ui-components:jupyterlab-wordmark', svgstr: jupyterlabWordmarkSvgstr });

+ 4 - 0
packages/ui-components/style/deprecated.css

@@ -46,6 +46,7 @@
   --jp-icon-image: url('icons/filetype/image.svg');
   --jp-icon-inspector: url('icons/filetype/inspector.svg');
   --jp-icon-json: url('icons/filetype/json.svg');
+  --jp-icon-julia: url('icons/filetype/julia.svg');
   --jp-icon-jupyter-favicon: url('icons/jupyter/jupyter-favicon.svg');
   --jp-icon-jupyter: url('icons/jupyter/jupyter.svg');
   --jp-icon-jupyterlab-wordmark: url('icons/jupyter/jupyterlab-wordmark.svg');
@@ -195,6 +196,9 @@
 .jp-JsonIcon {
   background-image: var(--jp-icon-json);
 }
+.jp-JuliaIcon {
+  background-image: var(--jp-icon-julia);
+}
 .jp-JupyterFaviconIcon {
   background-image: var(--jp-icon-jupyter-favicon);
 }

+ 11 - 0
packages/ui-components/style/icons/filetype/julia.svg

@@ -0,0 +1,11 @@
+<svg xmlns="http://www.w3.org/2000/svg" width="16" viewBox="0 0 325 300">
+  <g class="jp-brand0 jp-icon-selectable" fill="#cb3c33">
+    <path d="M 150.898438 225 C 150.898438 266.421875 117.320312 300 75.898438 300 C 34.476562 300 0.898438 266.421875 0.898438 225 C 0.898438 183.578125 34.476562 150 75.898438 150 C 117.320312 150 150.898438 183.578125 150.898438 225"/>
+  </g>
+  <g class="jp-brand0 jp-icon-selectable" fill="#389826">
+    <path d="M 237.5 75 C 237.5 116.421875 203.921875 150 162.5 150 C 121.078125 150 87.5 116.421875 87.5 75 C 87.5 33.578125 121.078125 0 162.5 0 C 203.921875 0 237.5 33.578125 237.5 75"/>
+  </g>
+  <g class="jp-brand0 jp-icon-selectable" fill="#9558b2">
+    <path d="M 324.101562 225 C 324.101562 266.421875 290.523438 300 249.101562 300 C 207.679688 300 174.101562 266.421875 174.101562 225 C 174.101562 183.578125 207.679688 150 249.101562 150 C 290.523438 150 324.101562 183.578125 324.101562 225"/>
+  </g>
+</svg>