@codingame/monaco-vscode-theme-service-override 24.2.0 → 25.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -3
- package/vscode/src/vs/platform/theme/common/sizeUtils.d.ts +90 -0
- package/vscode/src/vs/platform/theme/common/sizeUtils.js +127 -0
- package/vscode/src/vs/platform/theme/common/sizes/baseSizes.d.ts +11 -0
- package/vscode/src/vs/platform/theme/common/sizes/baseSizes.js +18 -0
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +51 -64
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +2 -2
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +12 -12
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +11 -2
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +25 -13
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +38 -38
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +7 -7
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +36 -36
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +21 -21
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-theme-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "25.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - theme service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,8 +15,8 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
19
|
-
"@codingame/monaco-vscode-files-service-override": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "25.0.0",
|
|
19
|
+
"@codingame/monaco-vscode-files-service-override": "25.0.0"
|
|
20
20
|
},
|
|
21
21
|
"main": "index.js",
|
|
22
22
|
"module": "index.js",
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { IJSONSchema } from "@codingame/monaco-vscode-api/vscode/vs/base/common/jsonSchema";
|
|
3
|
+
import { IColorTheme } from "@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService";
|
|
4
|
+
export type SizeIdentifier = string;
|
|
5
|
+
/**
|
|
6
|
+
* Size value unit types supported by the registry
|
|
7
|
+
*/
|
|
8
|
+
export type SizeUnit = "px" | "rem" | "em" | "%";
|
|
9
|
+
/**
|
|
10
|
+
* A size value with a numeric amount and unit
|
|
11
|
+
*/
|
|
12
|
+
export interface SizeValue {
|
|
13
|
+
readonly value: number;
|
|
14
|
+
readonly unit: SizeUnit;
|
|
15
|
+
}
|
|
16
|
+
export interface SizeContribution {
|
|
17
|
+
readonly id: SizeIdentifier;
|
|
18
|
+
readonly description: string;
|
|
19
|
+
readonly defaults: SizeDefaults | SizeValue | null;
|
|
20
|
+
readonly deprecationMessage: string | undefined;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Returns the css variable name for the given size identifier. Dots (`.`) are replaced with hyphens (`-`) and
|
|
24
|
+
* everything is prefixed with `--vscode-`.
|
|
25
|
+
*
|
|
26
|
+
* @sample `editor.fontSize` is `--vscode-editor-fontSize`.
|
|
27
|
+
*/
|
|
28
|
+
export declare function asCssVariableName(sizeIdent: SizeIdentifier): string;
|
|
29
|
+
export declare function asCssVariable(size: SizeIdentifier): string;
|
|
30
|
+
export declare function asCssVariableWithDefault(size: SizeIdentifier, defaultCssValue: string): string;
|
|
31
|
+
export interface SizeDefaults {
|
|
32
|
+
light: SizeValue | null;
|
|
33
|
+
dark: SizeValue | null;
|
|
34
|
+
hcDark: SizeValue | null;
|
|
35
|
+
hcLight: SizeValue | null;
|
|
36
|
+
}
|
|
37
|
+
export declare function isSizeDefaults(value: unknown): value is SizeDefaults;
|
|
38
|
+
/**
|
|
39
|
+
* Helper function to create a size value
|
|
40
|
+
*/
|
|
41
|
+
export declare function size(value: number, unit?: SizeUnit): SizeValue;
|
|
42
|
+
/**
|
|
43
|
+
* Helper function to create size defaults that use the same value for all themes
|
|
44
|
+
*/
|
|
45
|
+
export declare function sizeForAllThemes(value: number, unit?: SizeUnit): SizeDefaults;
|
|
46
|
+
/**
|
|
47
|
+
* Convert a size value to a CSS string
|
|
48
|
+
*/
|
|
49
|
+
export declare function sizeValueToCss(sizeValue: SizeValue): string;
|
|
50
|
+
export declare const Extensions: {
|
|
51
|
+
SizeContribution: string;
|
|
52
|
+
};
|
|
53
|
+
export declare const DEFAULT_SIZE_CONFIG_VALUE = "default";
|
|
54
|
+
export interface ISizeRegistry {
|
|
55
|
+
readonly onDidChangeSchema: Event<void>;
|
|
56
|
+
/**
|
|
57
|
+
* Register a size to the registry.
|
|
58
|
+
* @param id The size id as used in theme description files
|
|
59
|
+
* @param defaults The default values
|
|
60
|
+
* @param description the description
|
|
61
|
+
*/
|
|
62
|
+
registerSize(id: string, defaults: SizeDefaults | SizeValue | null, description: string): SizeIdentifier;
|
|
63
|
+
/**
|
|
64
|
+
* Deregister a size from the registry.
|
|
65
|
+
*/
|
|
66
|
+
deregisterSize(id: string): void;
|
|
67
|
+
/**
|
|
68
|
+
* Get all size contributions
|
|
69
|
+
*/
|
|
70
|
+
getSizes(): SizeContribution[];
|
|
71
|
+
/**
|
|
72
|
+
* Gets the default size of the given id
|
|
73
|
+
*/
|
|
74
|
+
resolveDefaultSize(id: SizeIdentifier, theme: IColorTheme): SizeValue | undefined;
|
|
75
|
+
/**
|
|
76
|
+
* JSON schema for an object to assign size values to one of the size contributions.
|
|
77
|
+
*/
|
|
78
|
+
getSizeSchema(): IJSONSchema;
|
|
79
|
+
/**
|
|
80
|
+
* JSON schema for a reference to a size contribution.
|
|
81
|
+
*/
|
|
82
|
+
getSizeReferenceSchema(): IJSONSchema;
|
|
83
|
+
/**
|
|
84
|
+
* Notify when the color theme or settings change.
|
|
85
|
+
*/
|
|
86
|
+
notifyThemeUpdate(theme: IColorTheme): void;
|
|
87
|
+
}
|
|
88
|
+
export declare function registerSize(id: string, defaults: SizeDefaults | SizeValue | null, description: string, deprecationMessage?: string): SizeIdentifier;
|
|
89
|
+
export declare function getSizeRegistry(): ISizeRegistry;
|
|
90
|
+
export declare const workbenchSizesSchemaId = "vscode://schemas/workbench-sizes";
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
|
|
2
|
+
import { Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
+
import { Extensions as Extensions$1 } from '@codingame/monaco-vscode-api/vscode/vs/platform/jsonschemas/common/jsonContributionRegistry';
|
|
4
|
+
import { Registry } from '@codingame/monaco-vscode-api/vscode/vs/platform/registry/common/platform';
|
|
5
|
+
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
6
|
+
import { RunOnceScheduler } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
7
|
+
|
|
8
|
+
function asCssVariableName(sizeIdent) {
|
|
9
|
+
return `--vscode-${sizeIdent.replace(/\./g, '-')}`;
|
|
10
|
+
}
|
|
11
|
+
function isSizeDefaults(value) {
|
|
12
|
+
return value !== null && typeof value === 'object' && 'light' in value && 'dark' in value;
|
|
13
|
+
}
|
|
14
|
+
function size(value, unit = 'px') {
|
|
15
|
+
return { value, unit };
|
|
16
|
+
}
|
|
17
|
+
function sizeForAllThemes(value, unit = 'px') {
|
|
18
|
+
const sizeValue = size(value, unit);
|
|
19
|
+
return {
|
|
20
|
+
light: sizeValue,
|
|
21
|
+
dark: sizeValue,
|
|
22
|
+
hcDark: sizeValue,
|
|
23
|
+
hcLight: sizeValue
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
function sizeValueToCss(sizeValue) {
|
|
27
|
+
return `${sizeValue.value}${sizeValue.unit}`;
|
|
28
|
+
}
|
|
29
|
+
const Extensions = {
|
|
30
|
+
SizeContribution: 'base.contributions.sizes'
|
|
31
|
+
};
|
|
32
|
+
class SizeRegistry extends Disposable {
|
|
33
|
+
constructor() {
|
|
34
|
+
super();
|
|
35
|
+
this._onDidChangeSchema = this._register(( new Emitter()));
|
|
36
|
+
this.onDidChangeSchema = this._onDidChangeSchema.event;
|
|
37
|
+
this.sizeSchema = { type: 'object', properties: {} };
|
|
38
|
+
this.sizeReferenceSchema = { type: 'string', enum: [], enumDescriptions: [] };
|
|
39
|
+
this.sizesById = {};
|
|
40
|
+
}
|
|
41
|
+
notifyThemeUpdate(theme) {
|
|
42
|
+
for (const key of ( Object.keys(this.sizesById))) {
|
|
43
|
+
const sizeVal = this.resolveDefaultSize(key, theme);
|
|
44
|
+
if (sizeVal) {
|
|
45
|
+
this.sizeSchema.properties[key].default = sizeValueToCss(sizeVal);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
this._onDidChangeSchema.fire();
|
|
49
|
+
}
|
|
50
|
+
registerSize(id, defaults, description, deprecationMessage) {
|
|
51
|
+
const sizeContribution = { id, description, defaults, deprecationMessage };
|
|
52
|
+
this.sizesById[id] = sizeContribution;
|
|
53
|
+
const propertySchema = {
|
|
54
|
+
type: 'string',
|
|
55
|
+
pattern: '^(\\d+(\\.\\d+)?(px|rem|em|%))|default$',
|
|
56
|
+
patternErrorMessage: 'Size must be a number followed by px, rem, em, or % (e.g., "12px", "1.5rem") or "default"'
|
|
57
|
+
};
|
|
58
|
+
if (deprecationMessage) {
|
|
59
|
+
propertySchema.deprecationMessage = deprecationMessage;
|
|
60
|
+
}
|
|
61
|
+
this.sizeSchema.properties[id] = {
|
|
62
|
+
description,
|
|
63
|
+
...propertySchema
|
|
64
|
+
};
|
|
65
|
+
this.sizeReferenceSchema.enum.push(id);
|
|
66
|
+
this.sizeReferenceSchema.enumDescriptions.push(description);
|
|
67
|
+
this._onDidChangeSchema.fire();
|
|
68
|
+
return id;
|
|
69
|
+
}
|
|
70
|
+
deregisterSize(id) {
|
|
71
|
+
delete this.sizesById[id];
|
|
72
|
+
delete this.sizeSchema.properties[id];
|
|
73
|
+
const index = this.sizeReferenceSchema.enum.indexOf(id);
|
|
74
|
+
if (index !== -1) {
|
|
75
|
+
this.sizeReferenceSchema.enum.splice(index, 1);
|
|
76
|
+
this.sizeReferenceSchema.enumDescriptions.splice(index, 1);
|
|
77
|
+
}
|
|
78
|
+
this._onDidChangeSchema.fire();
|
|
79
|
+
}
|
|
80
|
+
getSizes() {
|
|
81
|
+
return ( ( Object.keys(this.sizesById)).map(id => this.sizesById[id]));
|
|
82
|
+
}
|
|
83
|
+
resolveDefaultSize(id, theme) {
|
|
84
|
+
const sizeDesc = this.sizesById[id];
|
|
85
|
+
if (sizeDesc?.defaults) {
|
|
86
|
+
const sizeValue = isSizeDefaults(sizeDesc.defaults) ? sizeDesc.defaults[theme.type] : sizeDesc.defaults;
|
|
87
|
+
return sizeValue ?? undefined;
|
|
88
|
+
}
|
|
89
|
+
return undefined;
|
|
90
|
+
}
|
|
91
|
+
getSizeSchema() {
|
|
92
|
+
return this.sizeSchema;
|
|
93
|
+
}
|
|
94
|
+
getSizeReferenceSchema() {
|
|
95
|
+
return this.sizeReferenceSchema;
|
|
96
|
+
}
|
|
97
|
+
toString() {
|
|
98
|
+
const sorter = (a, b) => {
|
|
99
|
+
const cat1 = a.indexOf('.') === -1 ? 0 : 1;
|
|
100
|
+
const cat2 = b.indexOf('.') === -1 ? 0 : 1;
|
|
101
|
+
if (cat1 !== cat2) {
|
|
102
|
+
return cat1 - cat2;
|
|
103
|
+
}
|
|
104
|
+
return a.localeCompare(b);
|
|
105
|
+
};
|
|
106
|
+
return ( ( Object.keys(this.sizesById)).sort(sorter).map(k => `- \`${k}\`: ${this.sizesById[k].description}`)).join('\n');
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
const sizeRegistry = ( new SizeRegistry());
|
|
110
|
+
Registry.add(Extensions.SizeContribution, sizeRegistry);
|
|
111
|
+
function registerSize(id, defaults, description, deprecationMessage) {
|
|
112
|
+
return sizeRegistry.registerSize(id, defaults, description, deprecationMessage);
|
|
113
|
+
}
|
|
114
|
+
function getSizeRegistry() {
|
|
115
|
+
return sizeRegistry;
|
|
116
|
+
}
|
|
117
|
+
const workbenchSizesSchemaId = 'vscode://schemas/workbench-sizes';
|
|
118
|
+
const schemaRegistry = Registry.as(Extensions$1.JSONContribution);
|
|
119
|
+
schemaRegistry.registerSchema(workbenchSizesSchemaId, sizeRegistry.getSizeSchema());
|
|
120
|
+
const delayer = ( new RunOnceScheduler(() => schemaRegistry.notifySchemaChanged(workbenchSizesSchemaId), 200));
|
|
121
|
+
sizeRegistry.onDidChangeSchema(() => {
|
|
122
|
+
if (!delayer.isScheduled()) {
|
|
123
|
+
delayer.schedule();
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
export { Extensions, asCssVariableName, getSizeRegistry, isSizeDefaults, registerSize, size, sizeForAllThemes, sizeValueToCss, workbenchSizesSchemaId };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const bodyFontSize: string;
|
|
2
|
+
export declare const bodyFontSizeSmall: string;
|
|
3
|
+
export declare const bodyFontSizeXSmall: string;
|
|
4
|
+
export declare const codiconFontSize: string;
|
|
5
|
+
export declare const cornerRadiusMedium: string;
|
|
6
|
+
export declare const cornerRadiusXSmall: string;
|
|
7
|
+
export declare const cornerRadiusSmall: string;
|
|
8
|
+
export declare const cornerRadiusLarge: string;
|
|
9
|
+
export declare const cornerRadiusXLarge: string;
|
|
10
|
+
export declare const cornerRadiusCircle: string;
|
|
11
|
+
export declare const strokeThickness: string;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
|
|
2
|
+
import { localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
3
|
+
import { registerSize, sizeForAllThemes } from '../sizeUtils.js';
|
|
4
|
+
|
|
5
|
+
registerSize('bodyFontSize', sizeForAllThemes(13, 'px'), ( localize(
|
|
6
|
+
2372,
|
|
7
|
+
"Base font size. This size is used if not overridden by a component."
|
|
8
|
+
)));
|
|
9
|
+
registerSize('bodyFontSize.small', sizeForAllThemes(12, 'px'), ( localize(2373, "Small font size for secondary content.")));
|
|
10
|
+
registerSize('bodyFontSize.xSmall', sizeForAllThemes(11, 'px'), ( localize(2374, "Extra small font size for less prominent content.")));
|
|
11
|
+
registerSize('codiconFontSize', sizeForAllThemes(16, 'px'), ( localize(2375, "Base font size for codicons.")));
|
|
12
|
+
registerSize('cornerRadius.medium', sizeForAllThemes(6, 'px'), ( localize(2376, "Base corner radius for UI elements.")));
|
|
13
|
+
registerSize('cornerRadius.xSmall', sizeForAllThemes(2, 'px'), ( localize(2377, "Extra small corner radius for very compact UI elements.")));
|
|
14
|
+
registerSize('cornerRadius.small', sizeForAllThemes(4, 'px'), ( localize(2378, "Small corner radius for compact UI elements.")));
|
|
15
|
+
registerSize('cornerRadius.large', sizeForAllThemes(8, 'px'), ( localize(2379, "Large corner radius for prominent UI elements.")));
|
|
16
|
+
registerSize('cornerRadius.xLarge', sizeForAllThemes(12, 'px'), ( localize(2380, "Extra large corner radius for very prominent UI elements.")));
|
|
17
|
+
registerSize('cornerRadius.circle', sizeForAllThemes(9999, 'px'), ( localize(2381, "Circular corner radius for fully rounded UI elements.")));
|
|
18
|
+
registerSize('strokeThickness', sizeForAllThemes(1, 'px'), ( localize(2382, "Base stroke thickness for borders and outlines.")));
|
|
@@ -26,6 +26,7 @@ import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color'
|
|
|
26
26
|
import { ColorScheme, isHighContrast } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/theme';
|
|
27
27
|
import { colorThemeSchemaId } from '../../../services/themes/common/colorThemeSchema.js';
|
|
28
28
|
import { isCancellationError, onUnexpectedError } from '@codingame/monaco-vscode-api/vscode/vs/base/common/errors';
|
|
29
|
+
import { QuickInputButtonLocation } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput';
|
|
29
30
|
import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platform/quickinput/common/quickInput.service';
|
|
30
31
|
import { ProductIconThemeData, DEFAULT_PRODUCT_ICON_THEME_ID } from '../../../services/themes/browser/productIconThemeData.js';
|
|
31
32
|
import { ThrottledDelayer } from '@codingame/monaco-vscode-api/vscode/vs/base/common/async';
|
|
@@ -48,12 +49,10 @@ import '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/noti
|
|
|
48
49
|
import { INotificationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/notification/common/notification.service';
|
|
49
50
|
import { mainWindow } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/window';
|
|
50
51
|
import { IPreferencesService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/preferences/common/preferences.service';
|
|
51
|
-
import { Toggle } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/toggle/toggle';
|
|
52
|
-
import { defaultToggleStyles } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/browser/defaultStyles';
|
|
53
52
|
import { DisposableStore } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
54
53
|
import Severity from '@codingame/monaco-vscode-api/vscode/vs/base/common/severity';
|
|
55
54
|
|
|
56
|
-
const manageExtensionIcon = registerIcon('theme-selection-manage-extension', Codicon.gear, ( localize(
|
|
55
|
+
const manageExtensionIcon = registerIcon('theme-selection-manage-extension', Codicon.gear, ( localize(12774, 'Icon for the \'Manage\' action in the theme selection quick pick.')));
|
|
57
56
|
var ConfigureItem;
|
|
58
57
|
(function (ConfigureItem) {
|
|
59
58
|
ConfigureItem["BROWSE_GALLERY"] = "marketplace";
|
|
@@ -161,7 +160,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
161
160
|
quickpick.matchOnDescription = true;
|
|
162
161
|
quickpick.buttons = [this.quickInputService.backButton];
|
|
163
162
|
quickpick.title = 'Marketplace Themes';
|
|
164
|
-
quickpick.placeholder = ( localize(
|
|
163
|
+
quickpick.placeholder = ( localize(12775, "Type to Search More. Select to Install. Up/Down Keys to Preview"));
|
|
165
164
|
quickpick.canSelectMany = false;
|
|
166
165
|
disposables.add(quickpick.onDidChangeValue(() => this.trigger(quickpick.value)));
|
|
167
166
|
disposables.add(quickpick.onDidAccept(async (_) => {
|
|
@@ -213,7 +212,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
213
212
|
items = items.concat({ label: '$(loading~spin) Searching for themes...', id: undefined, alwaysShow: true });
|
|
214
213
|
}
|
|
215
214
|
else if (items.length === 0 && this._searchError) {
|
|
216
|
-
items = [{ label: `$(error) ${( localize(
|
|
215
|
+
items = [{ label: `$(error) ${( localize(12776, 'Error while searching for themes: {0}', this._searchError))}`, id: undefined, alwaysShow: true }];
|
|
217
216
|
}
|
|
218
217
|
const activeItemId = quickpick.activeItems[0]?.id;
|
|
219
218
|
const newActiveItem = activeItemId ? items.find(i => isItem(i) && i.id === activeItemId) : undefined;
|
|
@@ -232,12 +231,12 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
232
231
|
this.extensionsWorkbenchService.openSearch(`@id:${galleryExtension.identifier.id}`);
|
|
233
232
|
const result = await this.dialogService.confirm({
|
|
234
233
|
message: ( localize(
|
|
235
|
-
|
|
234
|
+
12777,
|
|
236
235
|
"This will install extension '{0}' published by '{1}'. Do you want to continue?",
|
|
237
236
|
galleryExtension.displayName,
|
|
238
237
|
galleryExtension.publisherDisplayName
|
|
239
238
|
)),
|
|
240
|
-
primaryButton: ( localize(
|
|
239
|
+
primaryButton: ( localize(12778, "OK"))
|
|
241
240
|
});
|
|
242
241
|
if (!result.confirmed) {
|
|
243
242
|
return false;
|
|
@@ -245,7 +244,7 @@ let MarketplaceThemesPicker = class MarketplaceThemesPicker {
|
|
|
245
244
|
try {
|
|
246
245
|
await this.progressService.withProgress({
|
|
247
246
|
location: ProgressLocation.Notification,
|
|
248
|
-
title: ( localize(
|
|
247
|
+
title: ( localize(12779, "Installing Extension {0}...", galleryExtension.displayName))
|
|
249
248
|
}, async () => {
|
|
250
249
|
await this.extensionManagementService.installFromGallery(galleryExtension, {
|
|
251
250
|
isMachineScoped: false,
|
|
@@ -326,10 +325,8 @@ let InstalledThemesPicker = class InstalledThemesPicker {
|
|
|
326
325
|
quickpick.placeholder = this.options.placeholderMessage;
|
|
327
326
|
quickpick.activeItems = [picks[autoFocusIndex]];
|
|
328
327
|
quickpick.canSelectMany = false;
|
|
329
|
-
quickpick.
|
|
330
|
-
quickpick.
|
|
331
|
-
disposables.add(toggle.onChange(() => this.options.onToggle?.(toggle, quickpick)));
|
|
332
|
-
});
|
|
328
|
+
quickpick.buttons = this.options.buttons ?? [];
|
|
329
|
+
disposables.add(quickpick.onDidTriggerButton(button => this.options.onButton?.(button, quickpick)));
|
|
333
330
|
quickpick.matchOnDescription = true;
|
|
334
331
|
disposables.add(quickpick.onDidAccept(async (_) => {
|
|
335
332
|
isCompleted = true;
|
|
@@ -393,7 +390,7 @@ registerAction2(class extends Action2 {
|
|
|
393
390
|
constructor() {
|
|
394
391
|
super({
|
|
395
392
|
id: SelectColorThemeCommandId,
|
|
396
|
-
title: ( localize2(
|
|
393
|
+
title: ( localize2(12780, 'Color Theme')),
|
|
397
394
|
category: Categories.Preferences,
|
|
398
395
|
f1: true,
|
|
399
396
|
keybinding: {
|
|
@@ -404,42 +401,32 @@ registerAction2(class extends Action2 {
|
|
|
404
401
|
}
|
|
405
402
|
getTitle(colorScheme) {
|
|
406
403
|
switch (colorScheme) {
|
|
407
|
-
case ColorScheme.DARK: return localize(
|
|
408
|
-
case ColorScheme.LIGHT: return localize(
|
|
409
|
-
case ColorScheme.HIGH_CONTRAST_DARK: return localize(
|
|
410
|
-
case ColorScheme.HIGH_CONTRAST_LIGHT: return localize(
|
|
404
|
+
case ColorScheme.DARK: return localize(12781, "Select Color Theme for System Dark Mode");
|
|
405
|
+
case ColorScheme.LIGHT: return localize(12782, "Select Color Theme for System Light Mode");
|
|
406
|
+
case ColorScheme.HIGH_CONTRAST_DARK: return localize(12783, "Select Color Theme for High Contrast Dark Mode");
|
|
407
|
+
case ColorScheme.HIGH_CONTRAST_LIGHT: return localize(12784, "Select Color Theme for High Contrast Light Mode");
|
|
411
408
|
default:
|
|
412
|
-
return localize(
|
|
409
|
+
return localize(12785, "Select Color Theme (detect system color mode disabled)");
|
|
413
410
|
}
|
|
414
411
|
}
|
|
415
412
|
async run(accessor) {
|
|
416
413
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
417
414
|
const preferencesService = accessor.get(IPreferencesService);
|
|
418
415
|
const preferredColorScheme = themeService.getPreferredColorScheme();
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
}));
|
|
427
|
-
}
|
|
428
|
-
else {
|
|
429
|
-
modeConfigureToggle = ( new Toggle({
|
|
430
|
-
title: ( localize(12735, 'Detect system color mode disabled. Click to configure.')),
|
|
431
|
-
icon: Codicon.colorMode,
|
|
432
|
-
isChecked: false,
|
|
433
|
-
...defaultToggleStyles
|
|
434
|
-
}));
|
|
435
|
-
}
|
|
416
|
+
const modeConfigureButton = {
|
|
417
|
+
tooltip: preferredColorScheme
|
|
418
|
+
? ( localize(12786, 'Detect system color mode enabled. Click to configure.'))
|
|
419
|
+
: ( localize(12787, 'Detect system color mode disabled. Click to configure.')),
|
|
420
|
+
iconClass: ThemeIcon.asClassName(Codicon.colorMode),
|
|
421
|
+
location: QuickInputButtonLocation.Inline
|
|
422
|
+
};
|
|
436
423
|
const options = {
|
|
437
|
-
installMessage: ( localize(
|
|
438
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
424
|
+
installMessage: ( localize(12788, "Install Additional Color Themes...")),
|
|
425
|
+
browseMessage: '$(plus) ' + ( localize(12789, "Browse Additional Color Themes...")),
|
|
439
426
|
placeholderMessage: this.getTitle(preferredColorScheme),
|
|
440
427
|
marketplaceTag: 'category:themes',
|
|
441
|
-
|
|
442
|
-
|
|
428
|
+
buttons: [modeConfigureButton],
|
|
429
|
+
onButton: async (_button, picker) => {
|
|
443
430
|
picker.hide();
|
|
444
431
|
await preferencesService.openSettings({ query: ThemeSettings.DETECT_COLOR_SCHEME });
|
|
445
432
|
}
|
|
@@ -450,9 +437,9 @@ registerAction2(class extends Action2 {
|
|
|
450
437
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
451
438
|
const themes = await themeService.getColorThemes();
|
|
452
439
|
const currentTheme = themeService.getColorTheme();
|
|
453
|
-
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(
|
|
454
|
-
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(
|
|
455
|
-
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(
|
|
440
|
+
const lightEntries = toEntries(themes.filter(t => t.type === ColorScheme.LIGHT), ( localize(12790, "light themes")));
|
|
441
|
+
const darkEntries = toEntries(themes.filter(t => t.type === ColorScheme.DARK), ( localize(12791, "dark themes")));
|
|
442
|
+
const hcEntries = toEntries(themes.filter(t => isHighContrast(t.type)), ( localize(12792, "high contrast themes")));
|
|
456
443
|
let picks;
|
|
457
444
|
switch (preferredColorScheme) {
|
|
458
445
|
case ColorScheme.DARK:
|
|
@@ -475,7 +462,7 @@ registerAction2(class extends Action2 {
|
|
|
475
462
|
constructor() {
|
|
476
463
|
super({
|
|
477
464
|
id: SelectFileIconThemeCommandId,
|
|
478
|
-
title: ( localize2(
|
|
465
|
+
title: ( localize2(12793, 'File Icon Theme')),
|
|
479
466
|
category: Categories.Preferences,
|
|
480
467
|
f1: true
|
|
481
468
|
});
|
|
@@ -483,8 +470,8 @@ registerAction2(class extends Action2 {
|
|
|
483
470
|
async run(accessor) {
|
|
484
471
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
485
472
|
const options = {
|
|
486
|
-
installMessage: ( localize(
|
|
487
|
-
placeholderMessage: ( localize(
|
|
473
|
+
installMessage: ( localize(12794, "Install Additional File Icon Themes...")),
|
|
474
|
+
placeholderMessage: ( localize(12795, "Select File Icon Theme (Up/Down Keys to Preview)")),
|
|
488
475
|
marketplaceTag: 'tag:icon-theme'
|
|
489
476
|
};
|
|
490
477
|
const setTheme = (theme, settingsTarget) => themeService.setFileIconTheme(theme, settingsTarget);
|
|
@@ -492,8 +479,8 @@ registerAction2(class extends Action2 {
|
|
|
492
479
|
const instantiationService = accessor.get(IInstantiationService);
|
|
493
480
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
494
481
|
const picks = [
|
|
495
|
-
{ type: 'separator', label: ( localize(
|
|
496
|
-
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(
|
|
482
|
+
{ type: 'separator', label: ( localize(12796, 'file icon themes')) },
|
|
483
|
+
{ id: '', theme: FileIconThemeData.noIconTheme, label: ( localize(12797, 'None')), description: ( localize(12798, 'Disable File Icons')) },
|
|
497
484
|
...toEntries(await themeService.getFileIconThemes()),
|
|
498
485
|
];
|
|
499
486
|
await picker.openQuickPick(picks, themeService.getFileIconTheme());
|
|
@@ -504,7 +491,7 @@ registerAction2(class extends Action2 {
|
|
|
504
491
|
constructor() {
|
|
505
492
|
super({
|
|
506
493
|
id: SelectProductIconThemeCommandId,
|
|
507
|
-
title: ( localize2(
|
|
494
|
+
title: ( localize2(12799, 'Product Icon Theme')),
|
|
508
495
|
category: Categories.Preferences,
|
|
509
496
|
f1: true
|
|
510
497
|
});
|
|
@@ -512,9 +499,9 @@ registerAction2(class extends Action2 {
|
|
|
512
499
|
async run(accessor) {
|
|
513
500
|
const themeService = accessor.get(IWorkbenchThemeService);
|
|
514
501
|
const options = {
|
|
515
|
-
installMessage: ( localize(
|
|
516
|
-
browseMessage: '$(plus) ' + ( localize(
|
|
517
|
-
placeholderMessage: ( localize(
|
|
502
|
+
installMessage: ( localize(12800, "Install Additional Product Icon Themes...")),
|
|
503
|
+
browseMessage: '$(plus) ' + ( localize(12801, "Browse Additional Product Icon Themes...")),
|
|
504
|
+
placeholderMessage: ( localize(12802, "Select Product Icon Theme (Up/Down Keys to Preview)")),
|
|
518
505
|
marketplaceTag: 'tag:product-icon-theme'
|
|
519
506
|
};
|
|
520
507
|
const setTheme = (theme, settingsTarget) => themeService.setProductIconTheme(theme, settingsTarget);
|
|
@@ -522,8 +509,8 @@ registerAction2(class extends Action2 {
|
|
|
522
509
|
const instantiationService = accessor.get(IInstantiationService);
|
|
523
510
|
const picker = instantiationService.createInstance(InstalledThemesPicker, options, setTheme, getMarketplaceColorThemes);
|
|
524
511
|
const picks = [
|
|
525
|
-
{ type: 'separator', label: ( localize(
|
|
526
|
-
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(
|
|
512
|
+
{ type: 'separator', label: ( localize(12803, 'product icon themes')) },
|
|
513
|
+
{ id: DEFAULT_PRODUCT_ICON_THEME_ID, theme: ProductIconThemeData.defaultTheme, label: ( localize(12804, 'Default')) },
|
|
527
514
|
...toEntries(await themeService.getProductIconThemes()),
|
|
528
515
|
];
|
|
529
516
|
await picker.openQuickPick(picks, themeService.getProductIconTheme());
|
|
@@ -581,13 +568,13 @@ function toEntries(themes, label) {
|
|
|
581
568
|
}
|
|
582
569
|
const configureButton = {
|
|
583
570
|
iconClass: ThemeIcon.asClassName(manageExtensionIcon),
|
|
584
|
-
tooltip: ( localize(
|
|
571
|
+
tooltip: ( localize(12805, "Manage Extension")),
|
|
585
572
|
};
|
|
586
573
|
registerAction2(class extends Action2 {
|
|
587
574
|
constructor() {
|
|
588
575
|
super({
|
|
589
576
|
id: 'workbench.action.generateColorTheme',
|
|
590
|
-
title: ( localize2(
|
|
577
|
+
title: ( localize2(12806, 'Generate Color Theme From Current Settings')),
|
|
591
578
|
category: Categories.Developer,
|
|
592
579
|
f1: true
|
|
593
580
|
});
|
|
@@ -637,7 +624,7 @@ registerAction2(class extends Action2 {
|
|
|
637
624
|
constructor() {
|
|
638
625
|
super({
|
|
639
626
|
id: toggleLightDarkThemesCommandId,
|
|
640
|
-
title: ( localize2(
|
|
627
|
+
title: ( localize2(12807, 'Toggle between Light/Dark Themes')),
|
|
641
628
|
category: Categories.Preferences,
|
|
642
629
|
f1: true,
|
|
643
630
|
});
|
|
@@ -649,13 +636,13 @@ registerAction2(class extends Action2 {
|
|
|
649
636
|
const preferencesService = accessor.get(IPreferencesService);
|
|
650
637
|
if (configurationService.getValue(ThemeSettings.DETECT_COLOR_SCHEME)) {
|
|
651
638
|
const message = ( localize(
|
|
652
|
-
|
|
639
|
+
12808,
|
|
653
640
|
"Cannot toggle between light and dark themes when `{0}` is enabled in settings.",
|
|
654
641
|
ThemeSettings.DETECT_COLOR_SCHEME
|
|
655
642
|
));
|
|
656
643
|
notificationService.prompt(Severity.Info, message, [
|
|
657
644
|
{
|
|
658
|
-
label: ( localize(
|
|
645
|
+
label: ( localize(12809, "Open Settings")),
|
|
659
646
|
run: () => {
|
|
660
647
|
return preferencesService.openUserSettings({ query: ThemeSettings.DETECT_COLOR_SCHEME });
|
|
661
648
|
}
|
|
@@ -693,7 +680,7 @@ registerAction2(class extends Action2 {
|
|
|
693
680
|
constructor() {
|
|
694
681
|
super({
|
|
695
682
|
id: browseColorThemesInMarketplaceCommandId,
|
|
696
|
-
title: ( localize2(
|
|
683
|
+
title: ( localize2(12810, 'Browse Color Themes in Marketplace')),
|
|
697
684
|
category: Categories.Preferences,
|
|
698
685
|
f1: true,
|
|
699
686
|
});
|
|
@@ -734,13 +721,13 @@ registerAction2(class extends Action2 {
|
|
|
734
721
|
});
|
|
735
722
|
const ThemesSubMenu = ( new MenuId('ThemesSubMenu'));
|
|
736
723
|
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
737
|
-
title: ( localize(
|
|
724
|
+
title: ( localize(12811, "Themes")),
|
|
738
725
|
submenu: ThemesSubMenu,
|
|
739
726
|
group: '2_configuration',
|
|
740
727
|
order: 7
|
|
741
728
|
});
|
|
742
729
|
MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
743
|
-
title: ( localize(
|
|
730
|
+
title: ( localize(12812, "&&Themes")),
|
|
744
731
|
submenu: ThemesSubMenu,
|
|
745
732
|
group: '2_configuration',
|
|
746
733
|
order: 7
|
|
@@ -748,21 +735,21 @@ MenuRegistry.appendMenuItem(MenuId.MenubarPreferencesMenu, {
|
|
|
748
735
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
749
736
|
command: {
|
|
750
737
|
id: SelectColorThemeCommandId,
|
|
751
|
-
title: ( localize(
|
|
738
|
+
title: ( localize(12780, 'Color Theme'))
|
|
752
739
|
},
|
|
753
740
|
order: 1
|
|
754
741
|
});
|
|
755
742
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
756
743
|
command: {
|
|
757
744
|
id: SelectFileIconThemeCommandId,
|
|
758
|
-
title: ( localize(
|
|
745
|
+
title: ( localize(12813, "File Icon Theme"))
|
|
759
746
|
},
|
|
760
747
|
order: 2
|
|
761
748
|
});
|
|
762
749
|
MenuRegistry.appendMenuItem(ThemesSubMenu, {
|
|
763
750
|
command: {
|
|
764
751
|
id: SelectProductIconThemeCommandId,
|
|
765
|
-
title: ( localize(
|
|
752
|
+
title: ( localize(12814, "Product Icon Theme"))
|
|
766
753
|
},
|
|
767
754
|
order: 3
|
|
768
755
|
});
|
|
@@ -141,13 +141,13 @@ class FileIconThemeLoader {
|
|
|
141
141
|
const contentValue = parse(content, errors);
|
|
142
142
|
if (errors.length > 0) {
|
|
143
143
|
return Promise.reject(( new Error(( localize(
|
|
144
|
-
|
|
144
|
+
14315,
|
|
145
145
|
"Problems parsing file icons file: {0}",
|
|
146
146
|
( errors.map(e => getParseErrorMessage(e.error))).join(', ')
|
|
147
147
|
)))));
|
|
148
148
|
}
|
|
149
149
|
else if (getNodeType(contentValue) !== 'object') {
|
|
150
|
-
return Promise.reject(( new Error(( localize(
|
|
150
|
+
return Promise.reject(( new Error(( localize(14316, "Invalid format for file icons theme file: Object expected.")))));
|
|
151
151
|
}
|
|
152
152
|
return Promise.resolve(contentValue);
|
|
153
153
|
});
|