ThemeIcon support (fixes #72489)

This commit is contained in:
Christof Marti
2020-01-24 21:40:12 +01:00
parent 8c2a25968f
commit ad063b9df9
3 changed files with 30 additions and 29 deletions

View File

@@ -8,6 +8,7 @@ import { ExtHostContext, MainThreadQuickOpenShape, ExtHostQuickOpenShape, Transf
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { URI } from 'vs/base/common/uri';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ThemeIcon } from 'vs/platform/theme/common/themeService';
interface QuickInputSession {
input: IQuickInput;
@@ -185,14 +186,22 @@ export class MainThreadQuickOpen implements MainThreadQuickOpenShape {
return this._quickInputService.backButton;
}
const { iconPath, tooltip, handle } = button;
return {
iconPath: iconPath && {
dark: URI.revive(iconPath.dark),
light: iconPath.light && URI.revive(iconPath.light)
},
tooltip,
handle
};
if ('id' in iconPath) {
return {
iconClass: ThemeIcon.asClassName(iconPath),
tooltip,
handle
};
} else {
return {
iconPath: {
dark: URI.revive(iconPath.dark),
light: iconPath.light && URI.revive(iconPath.light)
},
tooltip,
handle
};
}
});
} else {
(input as any)[param] = params[param];