Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace Octicons with Codicons #82729

Merged
merged 8 commits into from
Oct 17, 2019
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/gulpfile.editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ const extractEditorSrcTask = task.define('extract-editor-src', () => {
`lib.webworker.importscripts.d.ts`
],
redirects: {
'vs/base/browser/ui/octiconLabel/octiconLabel': 'vs/base/browser/ui/octiconLabel/octiconLabel.mock',
'vs/base/browser/ui/codiconLabel/codiconLabel': 'vs/base/browser/ui/codiconLabel/codiconLabel.mock',
miguelsolorio marked this conversation as resolved.
Show resolved Hide resolved
},
shakeLevel: 2, // 0-Files, 1-InnerFile, 2-ClassMembers
importIgnorePattern: /(^vs\/css!)|(promise-polyfill\/polyfill)/,
Expand Down
1 change: 0 additions & 1 deletion build/gulpfile.hygiene.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ const indentationFilter = [
'!**/yarn-error.log',

// except multiple specific folders
'!**/octicons/**',
'!**/codicon/**',
'!**/fixtures/**',
'!**/lib/**',
Expand Down
2 changes: 0 additions & 2 deletions build/gulpfile.vscode.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ const vscodeResources = [
'out-build/vs/base/common/performance.js',
'out-build/vs/base/node/languagePacks.js',
'out-build/vs/base/node/{stdForkStart.js,terminateProcess.sh,cpuUsage.sh,ps.sh}',
'out-build/vs/base/browser/ui/octiconLabel/octicons/**',
'out-build/vs/base/browser/ui/codiconLabel/codicon/**',
'out-build/vs/workbench/browser/media/*-theme.css',
'out-build/vs/workbench/contrib/debug/**/*.json',
Expand Down Expand Up @@ -534,4 +533,3 @@ function getSettingsSearchBuildId(packageJson) {
throw new Error('Could not determine build number: ' + e.toString());
}
}

22 changes: 5 additions & 17 deletions cgmanifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -96,25 +96,13 @@
"component": {
"type": "git",
"git": {
"name": "vscode-octicons-font",
"repositoryUrl": "https://github.com/Microsoft/vscode-octicons-font",
"commitHash": "4cbf2bd35cf0084eabd47d322cc58339fd7743cf"
"name": "vscode-codicons",
"repositoryUrl": "https://github.com/microsoft/vscode-codicons",
"commitHash": "7f14c092f65f658cd520df3f13765efe828d0ba4"
}
},
"license": "MIT",
"version": "1.3.2"
},
{
"component": {
"type": "git",
"git": {
"name": "octicons",
"repositoryUrl": "https://github.com/primer/octicons",
"commitHash": "d120bf97bc9a12fb415f69fedaf31fe58427ca56"
}
},
"license": "MIT",
"version": "8.3.0"
"license": "MIT and Creative Commons Attribution 4.0",
"version": "0.0.1"
},
{
"component": {
Expand Down
2 changes: 1 addition & 1 deletion extensions/html/test/colorize-fixtures/test.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
});
</script>
<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner hidden">
<span class=octicon></span>
<span class=codicon></span>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
Expand Down
4 changes: 2 additions & 2 deletions extensions/html/test/colorize-results/test_html.json
Original file line number Diff line number Diff line change
Expand Up @@ -2431,7 +2431,7 @@
}
},
{
"c": "octicon",
"c": "codicon",
"t": "text.html.derivative meta.tag.inline.span.start.html meta.attribute.class.html string.unquoted.html",
"r": {
"dark_plus": "string: #CE9178",
Expand Down Expand Up @@ -3189,4 +3189,4 @@
"hc_black": "punctuation.definition.tag: #808080"
}
}
]
]
6 changes: 0 additions & 6 deletions src/vs/base/browser/ui/actionbar/actionbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@
margin-right: 4px;
}

.monaco-action-bar .action-label.octicon {
font-size: 15px;
line-height: 35px;
text-align: center;
}

.monaco-action-bar .action-item.disabled .action-label,
.monaco-action-bar .action-item.disabled .action-label:hover {
opacity: 0.4;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,5 @@
}

.codicon-animation-spin {
animation: octicon-spin 1.5s linear infinite;
animation: codicon-spin 1.5s linear infinite;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@

import { escape } from 'vs/base/common/strings';

export function renderOcticons(text: string): string {
export function renderCodicons(text: string): string {
return escape(text);
}

export class OcticonLabel {
export class CodiconLabel {

private _container: HTMLElement;

Expand All @@ -18,7 +18,7 @@ export class OcticonLabel {
}

set text(text: string) {
this._container.innerHTML = renderOcticons(text || '');
this._container.innerHTML = renderCodicons(text || '');
}

}
8 changes: 4 additions & 4 deletions src/vs/base/browser/ui/highlightedlabel/highlightedLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class HighlightedLabel {
private highlights: IHighlight[] = [];
private didEverRender: boolean = false;

constructor(container: HTMLElement, private supportOcticons: boolean) {
constructor(container: HTMLElement, private supportCodicons: boolean) {
this.domNode = document.createElement('span');
this.domNode.className = 'monaco-highlighted-label';

Expand Down Expand Up @@ -65,21 +65,21 @@ export class HighlightedLabel {
if (pos < highlight.start) {
htmlContent += '<span>';
const substring = this.text.substring(pos, highlight.start);
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
htmlContent += this.supportCodicons ? renderCodicons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}
htmlContent += '<span class="highlight">';
const substring = this.text.substring(highlight.start, highlight.end);
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
htmlContent += this.supportCodicons ? renderCodicons(substring) : escape(substring);
htmlContent += '</span>';
pos = highlight.end;
}

if (pos < this.text.length) {
htmlContent += '<span>';
const substring = this.text.substring(pos);
htmlContent += this.supportOcticons ? renderCodicons(substring) : escape(substring);
htmlContent += this.supportCodicons ? renderCodicons(substring) : escape(substring);
htmlContent += '</span>';
}

Expand Down
6 changes: 3 additions & 3 deletions src/vs/base/browser/ui/iconLabel/iconLabel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import { Disposable } from 'vs/base/common/lifecycle';
export interface IIconLabelCreationOptions {
supportHighlights?: boolean;
supportDescriptionHighlights?: boolean;
supportOcticons?: boolean;
supportCodicons?: boolean;
}

export interface IIconLabelValueOptions {
Expand Down Expand Up @@ -100,13 +100,13 @@ export class IconLabel extends Disposable {
this.labelDescriptionContainer = this._register(new FastLabelNode(dom.append(this.domNode.element, dom.$('.monaco-icon-label-description-container'))));

if (options && options.supportHighlights) {
this.labelNode = new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')), !!options.supportOcticons);
this.labelNode = new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name')), !!options.supportCodicons);
} else {
this.labelNode = this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('a.label-name'))));
}

if (options && options.supportDescriptionHighlights) {
this.descriptionNodeFactory = () => new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')), !!options.supportOcticons);
this.descriptionNodeFactory = () => new HighlightedLabel(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description')), !!options.supportCodicons);
} else {
this.descriptionNodeFactory = () => this._register(new FastLabelNode(dom.append(this.labelDescriptionContainer.element, dom.$('span.label-description'))));
}
Expand Down
33 changes: 0 additions & 33 deletions src/vs/base/browser/ui/octiconLabel/octiconLabel.ts

This file was deleted.

This file was deleted.

Loading