ICommandAction support "uri-icon" and ThemeIcon

This commit is contained in:
Johannes Rieken
2019-11-29 10:02:42 +01:00
parent b157e4dc47
commit 91d0a62bf8
5 changed files with 28 additions and 12 deletions

View File

@@ -31,6 +31,7 @@ import { IFileService } from 'vs/platform/files/common/files';
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
import { IDialogMainService } from 'vs/platform/dialogs/electron-main/dialogs';
import { mnemonicButtonLabel } from 'vs/base/common/labels';
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
const RUN_TEXTMATE_IN_WORKER = false;
@@ -1089,7 +1090,7 @@ export class CodeWindow extends Disposable implements ICodeWindow {
private createTouchBarGroupSegments(items: ISerializableCommandAction[] = []): ITouchBarSegment[] {
const segments: ITouchBarSegment[] = items.map(item => {
let icon: NativeImage | undefined;
if (item.iconLocation && item.iconLocation?.dark?.scheme === 'file') {
if (item.iconLocation && !ThemeIcon.isThemeIcon(item.iconLocation) && item.iconLocation?.dark?.scheme === 'file') {
icon = nativeImage.createFromPath(URI.revive(item.iconLocation.dark).fsPath);
if (icon.isEmpty()) {
icon = undefined;