1 | "use strict";
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 |
|
15 |
|
16 |
|
17 | Object.defineProperty(exports, "__esModule", { value: true });
|
18 | exports.bindWindowPreferences = exports.createElectronWindowPreferences = exports.ElectronWindowPreferences = exports.ElectronWindowPreferenceContribution = exports.ElectronWindowConfiguration = exports.electronWindowPreferencesSchema = exports.ZoomLevel = void 0;
|
19 | const nls_1 = require("../../common/nls");
|
20 | const preferences_1 = require("../../browser/preferences");
|
21 | const common_1 = require("../../common");
|
22 | var ZoomLevel;
|
23 | (function (ZoomLevel) {
|
24 | ZoomLevel.DEFAULT = 0;
|
25 |
|
26 | ZoomLevel.MIN = -8;
|
27 | ZoomLevel.MAX = 9;
|
28 |
|
29 | ZoomLevel.VARIATION = 0.5;
|
30 | })(ZoomLevel = exports.ZoomLevel || (exports.ZoomLevel = {}));
|
31 | exports.electronWindowPreferencesSchema = {
|
32 | type: 'object',
|
33 | properties: {
|
34 | 'window.zoomLevel': {
|
35 | 'type': 'number',
|
36 | 'default': ZoomLevel.DEFAULT,
|
37 | 'minimum': ZoomLevel.MIN,
|
38 | 'maximum': ZoomLevel.MAX,
|
39 | 'scope': 'application',
|
40 |
|
41 | 'description': nls_1.nls.localizeByDefault('Adjust the zoom level of the window. The original size is 0 and each increment above (e.g. 1) or below (e.g. -1) represents zooming 20% larger or smaller. You can also enter decimals to adjust the zoom level with a finer granularity.')
|
42 | },
|
43 | 'window.titleBarStyle': {
|
44 | type: 'string',
|
45 | enum: ['native', 'custom'],
|
46 | default: common_1.isWindows ? 'custom' : 'native',
|
47 | scope: 'application',
|
48 |
|
49 | description: nls_1.nls.localizeByDefault('Adjust the appearance of the window title bar. On Linux and Windows, this setting also affects the application and context menu appearances. Changes require a full restart to apply.'),
|
50 | included: !common_1.isOSX
|
51 | },
|
52 | }
|
53 | };
|
54 | class ElectronWindowConfiguration {
|
55 | }
|
56 | exports.ElectronWindowConfiguration = ElectronWindowConfiguration;
|
57 | exports.ElectronWindowPreferenceContribution = Symbol('ElectronWindowPreferenceContribution');
|
58 | exports.ElectronWindowPreferences = Symbol('ElectronWindowPreferences');
|
59 | function createElectronWindowPreferences(preferences, schema = exports.electronWindowPreferencesSchema) {
|
60 | return (0, preferences_1.createPreferenceProxy)(preferences, schema);
|
61 | }
|
62 | exports.createElectronWindowPreferences = createElectronWindowPreferences;
|
63 | function bindWindowPreferences(bind) {
|
64 | bind(exports.ElectronWindowPreferences).toDynamicValue(ctx => {
|
65 | const preferences = ctx.container.get(preferences_1.PreferenceService);
|
66 | const contribution = ctx.container.get(exports.ElectronWindowPreferenceContribution);
|
67 | return createElectronWindowPreferences(preferences, contribution.schema);
|
68 | }).inSingletonScope();
|
69 | bind(exports.ElectronWindowPreferenceContribution).toConstantValue({ schema: exports.electronWindowPreferencesSchema });
|
70 | bind(preferences_1.PreferenceContribution).toService(exports.ElectronWindowPreferenceContribution);
|
71 | }
|
72 | exports.bindWindowPreferences = bindWindowPreferences;
|
73 |
|
\ | No newline at end of file |