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

Fix for displaying icons when icon theme is disabled #201709

Merged
merged 2 commits into from
Jan 8, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/vs/editor/common/services/getIconClasses.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const fileIconDirectoryRegex = /(?:\/|^)(?:([^\/]+)\/)?([^\/]+)$/;

export function getIconClasses(modelService: IModelService, languageService: ILanguageService, resource: uri | undefined, fileKind?: FileKind, icon?: ThemeIcon): string[] {
if (icon) {
return [`codicon-${icon.id}`, 'product-icon'];
return [`codicon-${icon.id}`, 'predefined-file-icon'];
}

// we always set these base classes even if we do not have a path
Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/browser/media/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,17 @@ body.web {
font-size: 16px; /* sets font-size for codicons in workbench (https://github.com/microsoft/vscode/issues/98495) */
}

.monaco-workbench .product-icon[class*='codicon-']::before {
.monaco-workbench .predefined-file-icon[class*='codicon-']::before {
font-family: 'codicon';
width: 16px;
padding-left: 3px; /* width (16px) - font-size (13px) = padding-left (3px) */
padding-right: 3px;
}

.monaco-workbench:not(.file-icons-enabled) .predefined-file-icon[class*='codicon-']::before {
content: unset !important;
}

.monaco-workbench.modal-dialog-visible .monaco-progress-container.infinite .progress-bit {
display: none; /* stop progress animations when dialogs are visible (https://github.com/microsoft/vscode/issues/138396) */
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ export class TerminalEditorInput extends EditorInput implements IEditorCloseHand
if (!this._terminalInstance) {
return [];
}
const extraClasses: string[] = ['terminal-tab', 'product-icon'];
const extraClasses: string[] = ['terminal-tab', 'predefined-file-icon'];
const colorClass = getColorClass(this._terminalInstance);
if (colorClass) {
extraClasses.push(colorClass);
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/contrib/terminal/browser/terminalIcon.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ export function getColorStyleContent(colorTheme: IColorTheme, editor?: boolean):
if (color) {
if (editor) {
css += (
`.monaco-workbench .show-file-icons .product-icon.terminal-tab.${colorClass}::before,` +
`.monaco-workbench .show-file-icons .predefined-file-icon.terminal-tab.${colorClass}::before,` +
`.monaco-workbench .show-file-icons .file-icon.terminal-tab.${colorClass}::before` +
`{ color: ${color} !important; }`
);
Expand Down