Fix errors due to icon to codicon rename in VSCode (#7837)

Found numerous errors where icons weren't rendering correctly.
- Anything that's an action must have CSS using "codicon" not "icon"
since VSCode sets the "codicon" class automatically.
This affected Agent view in particular, but also:
  - acounts view
  - new tab view in dashboard
 - many more
- Anything referencing the common-icons.css icons needed updating.
This hid help tooltip text in FormContainer UI for example.
- Finally I tried to convert all references from icon -> codicon,
even when the CSS was technically correct. This was done
for maintainability reasons - from now on always add codicon.

Fixes #7827
This commit is contained in:
Kevin Cunnane
2019-10-21 12:02:30 -07:00
committed by GitHub
parent 53a081262d
commit c1e95a2246
41 changed files with 114 additions and 113 deletions

View File

@@ -53,7 +53,7 @@ interface ExtensionListTemplate {
class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionListTemplate> {
public static TEMPLATE_ID = 'extensionListRenderer';
private static readonly OPENED_TAB_CLASS = 'success';
private static readonly ICON_CLASS = 'extension-status-icon icon';
private static readonly ICON_CLASS = 'extension-status-icon codicon';
public get templateId(): string {
return ExtensionListRenderer.TEMPLATE_ID;
@@ -62,7 +62,7 @@ class ExtensionListRenderer implements IListRenderer<IDashboardUITab, ExtensionL
public renderTemplate(container: HTMLElement): ExtensionListTemplate {
const tableTemplate: ExtensionListTemplate = Object.create(null);
tableTemplate.root = DOM.append(container, DOM.$('div.list-row.extensionTab-list'));
tableTemplate.icon = DOM.append(tableTemplate.root, DOM.$('div.icon'));
tableTemplate.icon = DOM.append(tableTemplate.root, DOM.$('div.codicon'));
let titleContainer = DOM.append(tableTemplate.root, DOM.$('div.extension-details'));
tableTemplate.title = DOM.append(titleContainer, DOM.$('div.title'));
tableTemplate.description = DOM.append(titleContainer, DOM.$('div.description'));

View File

@@ -107,13 +107,13 @@ export class ErrorMessageDialog extends Modal {
private updateIconTitle(): void {
switch (this._severity) {
case Severity.Error:
this.titleIconClassName = 'sql icon error';
this.titleIconClassName = 'sql codicon error';
break;
case Severity.Warning:
this.titleIconClassName = 'sql icon warning';
this.titleIconClassName = 'sql codicon warning';
break;
case Severity.Info:
this.titleIconClassName = 'sql icon info';
this.titleIconClassName = 'sql codicon info';
break;
}
}

View File

@@ -9,7 +9,7 @@
height: 200px;
}
.error-dialog .icon.error, .error-dialog .icon.warning , .error-dialog .icon.info {
.error-dialog .codicon.error, .error-dialog .codicon.warning , .error-dialog .codicon.info {
width: 20px;
height: 20px;
float: left;
@@ -22,6 +22,6 @@
user-select: text;
}
.modal .footer-button a.monaco-button.monaco-text-button.icon.scriptToClipboard {
.modal .footer-button a.monaco-button.monaco-text-button.codicon.scriptToClipboard {
width: 120px;
}
}

View File

@@ -45,6 +45,7 @@ import { ITextResourcePropertiesService } from 'vs/editor/common/services/resour
const labelDisplay = nls.localize("insights.item", "Item");
const valueDisplay = nls.localize("insights.value", "Value");
const iconClass = 'codicon';
class InsightTableView<T> extends ViewletPanel {
private _table: Table<T>;
@@ -88,22 +89,22 @@ function stateFormatter(row: number, cell: number, value: any, columnDef: Slick.
// render icon if passed
if (resource.icon) {
icon.classList.add('icon');
icon.classList.add(iconClass);
icon.classList.add(resource.icon);
} else {
icon.classList.remove('icon');
icon.classList.remove(iconClass);
}
//render state badge if present
if (resource.stateColor) {
badgeContent.style.backgroundColor = resource.stateColor;
badgeContent.classList.remove('icon');
badgeContent.classList.remove(iconClass);
} else if (resource.stateIcon) {
badgeContent.style.backgroundColor = '';
badgeContent.classList.add('icon');
badgeContent.classList.add(iconClass);
badgeContent.classList.add(resource.stateIcon);
} else {
badgeContent.classList.remove('icon');
badgeContent.classList.remove(iconClass);
badgeContent.style.backgroundColor = '';
}

View File

@@ -3,7 +3,7 @@
* Licensed under the Source EULA. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
.insights span {
.insights span {
display: inline-block;
text-overflow: ellipsis;
overflow: hidden;
@@ -30,4 +30,4 @@
overflow: hidden;
width: 22px;
height: 22px;
}
}