@codingame/monaco-vscode-theme-service-override 37.2.0 → 37.3.1
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/index.js +2 -1
- package/package.json +3 -3
- package/vscode/src/vs/sessions/common/sizes.d.ts +22 -0
- package/vscode/src/vs/sessions/common/sizes.js +20 -0
- package/vscode/src/vs/workbench/contrib/themes/browser/themes.contribution.js +49 -49
- package/vscode/src/vs/workbench/services/themes/browser/fileIconThemeData.js +5 -5
- package/vscode/src/vs/workbench/services/themes/browser/productIconThemeData.js +13 -13
- package/vscode/src/vs/workbench/services/themes/browser/workbenchThemeService.js +5 -5
- package/vscode/src/vs/workbench/services/themes/common/colorThemeSchema.js +16 -16
- package/vscode/src/vs/workbench/services/themes/common/fileIconThemeSchema.js +39 -39
- package/vscode/src/vs/workbench/services/themes/common/productIconThemeSchema.js +7 -7
- package/vscode/src/vs/workbench/services/themes/common/themeConfiguration.js +55 -47
- package/vscode/src/vs/workbench/services/themes/common/themeExtensionPoints.js +21 -21
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/activityBar.css +0 -301
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/commandCenter.css +0 -47
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/editorBorder.css +0 -96
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/fontRamp.css +0 -206
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/keyboardFocusOnly.css +0 -44
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/notificationsDialogs.css +0 -146
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/padding.css +0 -377
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/paneHeaders.css +0 -123
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/roundedCorners.css +0 -287
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/sashHandles.css +0 -94
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/shadows.css +0 -52
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/statusBar.css +0 -97
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/tabs.css +0 -1044
- package/vscode/src/vs/workbench/contrib/modernUI/browser/media/titlebar.css +0 -19
- package/vscode/src/vs/workbench/contrib/modernUI/browser/modernUI.contribution.d.ts +0 -28
- package/vscode/src/vs/workbench/contrib/modernUI/browser/modernUI.contribution.js +0 -219
- package/vscode/src/vs/workbench/services/themes/browser/modernTabColorCustomizations.d.ts +0 -1
- package/vscode/src/vs/workbench/services/themes/browser/modernTabColorCustomizations.js +0 -255
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
/*---------------------------------------------------------------------------------------------
|
|
2
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
-
* Licensed under the MIT License. See License.txt in the project root for license information.
|
|
4
|
-
*--------------------------------------------------------------------------------------------*/
|
|
5
|
-
|
|
6
|
-
/*
|
|
7
|
-
* Modern UI module: "Title Bar".
|
|
8
|
-
*
|
|
9
|
-
* Adds a small amount of top padding to the title-bar left/center/right
|
|
10
|
-
* containers so their items read as vertically centered. Scoped to macOS for
|
|
11
|
-
* now. All rules are gated behind the `.modern-ui` class, which the
|
|
12
|
-
* ModernUIContribution toggles onto the workbench container(s) when the
|
|
13
|
-
* Modern UI Update setting is enabled.
|
|
14
|
-
*/
|
|
15
|
-
.modern-ui.monaco-workbench.mac .part.titlebar > .titlebar-container > .titlebar-left,
|
|
16
|
-
.modern-ui.monaco-workbench.mac .part.titlebar > .titlebar-container > .titlebar-center,
|
|
17
|
-
.modern-ui.monaco-workbench.mac .part.titlebar > .titlebar-container > .titlebar-right {
|
|
18
|
-
padding-top: var(--vscode-spacing-size20);
|
|
19
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { Disposable } from "@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle";
|
|
2
|
-
import { IConfigurationService } from "@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service";
|
|
3
|
-
import { IWorkbenchLayoutService } from "@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service";
|
|
4
|
-
import { IWorkbenchContribution } from "@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions";
|
|
5
|
-
/**
|
|
6
|
-
* A contribution that toggles the built-in CSS Modern UI modules on or off
|
|
7
|
-
* as a group, based on the `workbench.experimental.modernUI` setting. When the
|
|
8
|
-
* Modern UI Update experiment is enabled, all modules are applied together;
|
|
9
|
-
* otherwise none are.
|
|
10
|
-
*/
|
|
11
|
-
export declare class ModernUIContribution extends Disposable implements IWorkbenchContribution {
|
|
12
|
-
private readonly configurationService;
|
|
13
|
-
private readonly layoutService;
|
|
14
|
-
static readonly ID = "workbench.contrib.modernUI";
|
|
15
|
-
private readonly hasLayoutAffectingModule;
|
|
16
|
-
private layoutAffectingState;
|
|
17
|
-
constructor(configurationService: IConfigurationService, layoutService: IWorkbenchLayoutService);
|
|
18
|
-
private isEnabled;
|
|
19
|
-
private useUppercaseViewHeaders;
|
|
20
|
-
private isCompact;
|
|
21
|
-
private getLayoutAffectingState;
|
|
22
|
-
private update;
|
|
23
|
-
private applyTo;
|
|
24
|
-
private applyScrollbarSize;
|
|
25
|
-
private applyNotificationRowHeight;
|
|
26
|
-
private applyPaneHeaderSize;
|
|
27
|
-
dispose(): void;
|
|
28
|
-
}
|
|
@@ -1,219 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerCss } from '@codingame/monaco-vscode-api/css';
|
|
3
|
-
import { __decorate, __param } from '@codingame/monaco-vscode-api/external/tslib/tslib.es6';
|
|
4
|
-
import { Disposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
5
|
-
import { localize2, localize } from '@codingame/monaco-vscode-api/vscode/vs/nls';
|
|
6
|
-
import { MenuId, MenuRegistry, registerAction2, Action2 } from '@codingame/monaco-vscode-api/vscode/vs/platform/actions/common/actions';
|
|
7
|
-
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
8
|
-
import { ContextKeyExpr } from '@codingame/monaco-vscode-api/vscode/vs/platform/contextkey/common/contextkey';
|
|
9
|
-
import { ModernUIDensity, LayoutSettings } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService';
|
|
10
|
-
import { IWorkbenchLayoutService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/layout/browser/layoutService.service';
|
|
11
|
-
import { registerWorkbenchContribution2, WorkbenchPhase } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contributions';
|
|
12
|
-
import { setGlobalDefaultScrollbarSize, DEFAULT_SCROLLBAR_SIZE } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/scrollbar/scrollableElement';
|
|
13
|
-
import { setNotificationRowHeight, COMPACT_NOTIFICATION_ROW_HEIGHT, DEFAULT_NOTIFICATION_ROW_HEIGHT } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/notifications/notificationsViewer';
|
|
14
|
-
import { DEFAULT_PANE_HEADER_SIZE, setGlobalPaneHeaderSize } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/ui/splitview/paneview';
|
|
15
|
-
import * as activityBar from './media/activityBar.css';
|
|
16
|
-
import * as commandCenter from './media/commandCenter.css';
|
|
17
|
-
import * as editorBorder from './media/editorBorder.css';
|
|
18
|
-
import * as fontRamp from './media/fontRamp.css';
|
|
19
|
-
import * as keyboardFocusOnly from './media/keyboardFocusOnly.css';
|
|
20
|
-
import * as notificationsDialogs from './media/notificationsDialogs.css';
|
|
21
|
-
import * as padding from './media/padding.css';
|
|
22
|
-
import * as paneHeaders from './media/paneHeaders.css';
|
|
23
|
-
import * as roundedCorners from './media/roundedCorners.css';
|
|
24
|
-
import * as sashHandles from './media/sashHandles.css';
|
|
25
|
-
import * as shadows from './media/shadows.css';
|
|
26
|
-
import * as statusBar from './media/statusBar.css';
|
|
27
|
-
import * as tabs from './media/tabs.css';
|
|
28
|
-
import * as titlebar from './media/titlebar.css';
|
|
29
|
-
import '../../../services/themes/browser/modernTabColorCustomizations.js';
|
|
30
|
-
|
|
31
|
-
const MODERN_UI_SCROLLBAR_SIZE = 8;
|
|
32
|
-
const MODERN_UI_PANE_HEADER_SIZE = 28;
|
|
33
|
-
registerCss(activityBar);
|
|
34
|
-
registerCss(commandCenter);
|
|
35
|
-
registerCss(editorBorder);
|
|
36
|
-
registerCss(fontRamp);
|
|
37
|
-
registerCss(keyboardFocusOnly);
|
|
38
|
-
registerCss(notificationsDialogs);
|
|
39
|
-
registerCss(padding);
|
|
40
|
-
registerCss(paneHeaders);
|
|
41
|
-
registerCss(roundedCorners);
|
|
42
|
-
registerCss(sashHandles);
|
|
43
|
-
registerCss(shadows);
|
|
44
|
-
registerCss(statusBar);
|
|
45
|
-
registerCss(tabs);
|
|
46
|
-
registerCss(titlebar);
|
|
47
|
-
const MODERN_UI_CLASS = "modern-ui";
|
|
48
|
-
const MODERN_UI_COMPACT_CLASS = "modern-ui-compact";
|
|
49
|
-
const MODERN_UI_TABS_CLASS = "modern-ui-tabs";
|
|
50
|
-
const MODERN_UI_NOTIFICATIONS_DIALOGS_CLASS = "modern-ui-notifications-dialogs";
|
|
51
|
-
const MODERN_UI_UPPERCASE_VIEW_HEADERS_CLASS = "modern-ui-uppercase-view-headers";
|
|
52
|
-
const LayoutDensityMenu = ( new MenuId("LayoutDensityMenu"));
|
|
53
|
-
const layoutDensityOptions = [{
|
|
54
|
-
density: ModernUIDensity.Default,
|
|
55
|
-
title: ( localize2(14321, "Default"))
|
|
56
|
-
}, {
|
|
57
|
-
density: ModernUIDensity.Compact,
|
|
58
|
-
title: ( localize2(14322, "Compact"))
|
|
59
|
-
}];
|
|
60
|
-
MenuRegistry.appendMenuItem(MenuId.GlobalActivity, {
|
|
61
|
-
title: ( localize(14323, "Layout Density")),
|
|
62
|
-
submenu: LayoutDensityMenu,
|
|
63
|
-
group: "2_configuration",
|
|
64
|
-
order: 8,
|
|
65
|
-
when: ( ContextKeyExpr.equals(`config.${LayoutSettings.MODERN_UI}`, true))
|
|
66
|
-
});
|
|
67
|
-
for (let index = 0; index < layoutDensityOptions.length; index++) {
|
|
68
|
-
const option = layoutDensityOptions[index];
|
|
69
|
-
registerAction2(class extends Action2 {
|
|
70
|
-
constructor() {
|
|
71
|
-
super({
|
|
72
|
-
id: `workbench.action.setLayoutDensity.${option.density}`,
|
|
73
|
-
title: option.title,
|
|
74
|
-
toggled: ( ContextKeyExpr.equals(`config.${LayoutSettings.MODERN_UI_DENSITY}`, option.density)),
|
|
75
|
-
menu: {
|
|
76
|
-
id: LayoutDensityMenu,
|
|
77
|
-
order: index + 1
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
}
|
|
81
|
-
run(accessor) {
|
|
82
|
-
return accessor.get(IConfigurationService).updateValue(LayoutSettings.MODERN_UI_DENSITY, option.density);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
const MODERN_UI_MODULES = [{
|
|
87
|
-
id: "activityBar"
|
|
88
|
-
}, {
|
|
89
|
-
id: "commandCenter"
|
|
90
|
-
}, {
|
|
91
|
-
id: "editorBorder"
|
|
92
|
-
}, {
|
|
93
|
-
id: "fontRamp"
|
|
94
|
-
}, {
|
|
95
|
-
id: "keyboardFocusOnly"
|
|
96
|
-
}, {
|
|
97
|
-
id: "padding"
|
|
98
|
-
}, {
|
|
99
|
-
id: "paneHeaders",
|
|
100
|
-
layoutAffecting: true
|
|
101
|
-
}, {
|
|
102
|
-
id: "roundedCorners"
|
|
103
|
-
}, {
|
|
104
|
-
id: "sashHandles"
|
|
105
|
-
}, {
|
|
106
|
-
id: "scrollShadows"
|
|
107
|
-
}, {
|
|
108
|
-
id: "shadows"
|
|
109
|
-
}, {
|
|
110
|
-
id: "statusBar"
|
|
111
|
-
}, {
|
|
112
|
-
id: "tabs"
|
|
113
|
-
}, {
|
|
114
|
-
id: "titlebar"
|
|
115
|
-
}, {
|
|
116
|
-
id: "notificationsDialogs"
|
|
117
|
-
}];
|
|
118
|
-
let ModernUIContribution = class ModernUIContribution extends Disposable {
|
|
119
|
-
static {
|
|
120
|
-
this.ID = "workbench.contrib.modernUI";
|
|
121
|
-
}
|
|
122
|
-
constructor(configurationService, layoutService) {
|
|
123
|
-
super();
|
|
124
|
-
this.configurationService = configurationService;
|
|
125
|
-
this.layoutService = layoutService;
|
|
126
|
-
this.hasLayoutAffectingModule = ( MODERN_UI_MODULES.some(m => m.layoutAffecting));
|
|
127
|
-
this.layoutAffectingState = "disabled";
|
|
128
|
-
this.layoutAffectingState = this.getLayoutAffectingState();
|
|
129
|
-
this._register(this.configurationService.onDidChangeConfiguration(e => {
|
|
130
|
-
if (e.affectsConfiguration(LayoutSettings.MODERN_UI) || e.affectsConfiguration(LayoutSettings.MODERN_UI_DENSITY) || e.affectsConfiguration(LayoutSettings.MODERN_UI_UPPERCASE_VIEW_HEADERS)) {
|
|
131
|
-
this.update();
|
|
132
|
-
const layoutAffectingState = this.getLayoutAffectingState();
|
|
133
|
-
if (layoutAffectingState !== this.layoutAffectingState) {
|
|
134
|
-
this.layoutAffectingState = layoutAffectingState;
|
|
135
|
-
this.layoutService.layout();
|
|
136
|
-
}
|
|
137
|
-
}
|
|
138
|
-
}));
|
|
139
|
-
this._register(this.layoutService.onDidAddContainer((
|
|
140
|
-
{
|
|
141
|
-
container
|
|
142
|
-
}
|
|
143
|
-
) => {
|
|
144
|
-
const enabled = this.isEnabled();
|
|
145
|
-
this.applyTo(
|
|
146
|
-
container,
|
|
147
|
-
enabled,
|
|
148
|
-
enabled && this.isCompact(),
|
|
149
|
-
enabled && this.useUppercaseViewHeaders()
|
|
150
|
-
);
|
|
151
|
-
}));
|
|
152
|
-
this.update();
|
|
153
|
-
}
|
|
154
|
-
isEnabled() {
|
|
155
|
-
return this.configurationService.getValue(LayoutSettings.MODERN_UI) === true;
|
|
156
|
-
}
|
|
157
|
-
useUppercaseViewHeaders() {
|
|
158
|
-
return this.configurationService.getValue(LayoutSettings.MODERN_UI_UPPERCASE_VIEW_HEADERS) === true;
|
|
159
|
-
}
|
|
160
|
-
isCompact() {
|
|
161
|
-
return this.configurationService.getValue(LayoutSettings.MODERN_UI_DENSITY) === ModernUIDensity.Compact;
|
|
162
|
-
}
|
|
163
|
-
getLayoutAffectingState() {
|
|
164
|
-
if (!this.isEnabled() || !this.hasLayoutAffectingModule) {
|
|
165
|
-
return "disabled";
|
|
166
|
-
}
|
|
167
|
-
return this.isCompact() ? ModernUIDensity.Compact : ModernUIDensity.Default;
|
|
168
|
-
}
|
|
169
|
-
update() {
|
|
170
|
-
const enabled = this.isEnabled();
|
|
171
|
-
const compact = enabled && this.isCompact();
|
|
172
|
-
const useUppercaseViewHeaders = enabled && this.useUppercaseViewHeaders();
|
|
173
|
-
this.applyPaneHeaderSize(enabled);
|
|
174
|
-
for (const container of this.layoutService.containers) {
|
|
175
|
-
this.applyTo(container, enabled, compact, useUppercaseViewHeaders);
|
|
176
|
-
}
|
|
177
|
-
this.applyScrollbarSize(enabled);
|
|
178
|
-
this.applyNotificationRowHeight(enabled);
|
|
179
|
-
}
|
|
180
|
-
applyTo(container, enabled, compact, useUppercaseViewHeaders) {
|
|
181
|
-
container.classList.toggle(MODERN_UI_CLASS, enabled);
|
|
182
|
-
container.classList.toggle(MODERN_UI_COMPACT_CLASS, compact);
|
|
183
|
-
container.classList.toggle(MODERN_UI_TABS_CLASS, enabled);
|
|
184
|
-
container.classList.toggle(MODERN_UI_NOTIFICATIONS_DIALOGS_CLASS, enabled);
|
|
185
|
-
container.classList.toggle(MODERN_UI_UPPERCASE_VIEW_HEADERS_CLASS, useUppercaseViewHeaders);
|
|
186
|
-
}
|
|
187
|
-
applyScrollbarSize(enabled) {
|
|
188
|
-
setGlobalDefaultScrollbarSize(enabled ? MODERN_UI_SCROLLBAR_SIZE : DEFAULT_SCROLLBAR_SIZE);
|
|
189
|
-
}
|
|
190
|
-
applyNotificationRowHeight(enabled) {
|
|
191
|
-
setNotificationRowHeight(
|
|
192
|
-
enabled ? COMPACT_NOTIFICATION_ROW_HEIGHT : DEFAULT_NOTIFICATION_ROW_HEIGHT
|
|
193
|
-
);
|
|
194
|
-
}
|
|
195
|
-
applyPaneHeaderSize(enabled) {
|
|
196
|
-
let paneHeaderSize = DEFAULT_PANE_HEADER_SIZE;
|
|
197
|
-
if (enabled) {
|
|
198
|
-
paneHeaderSize = MODERN_UI_PANE_HEADER_SIZE;
|
|
199
|
-
}
|
|
200
|
-
setGlobalPaneHeaderSize(paneHeaderSize);
|
|
201
|
-
}
|
|
202
|
-
dispose() {
|
|
203
|
-
for (const container of this.layoutService.containers) {
|
|
204
|
-
container.classList.remove(MODERN_UI_CLASS);
|
|
205
|
-
container.classList.remove(MODERN_UI_COMPACT_CLASS);
|
|
206
|
-
container.classList.remove(MODERN_UI_TABS_CLASS);
|
|
207
|
-
container.classList.remove(MODERN_UI_NOTIFICATIONS_DIALOGS_CLASS);
|
|
208
|
-
container.classList.remove(MODERN_UI_UPPERCASE_VIEW_HEADERS_CLASS);
|
|
209
|
-
}
|
|
210
|
-
setGlobalDefaultScrollbarSize(DEFAULT_SCROLLBAR_SIZE);
|
|
211
|
-
setNotificationRowHeight(DEFAULT_NOTIFICATION_ROW_HEIGHT);
|
|
212
|
-
setGlobalPaneHeaderSize(DEFAULT_PANE_HEADER_SIZE);
|
|
213
|
-
super.dispose();
|
|
214
|
-
}
|
|
215
|
-
};
|
|
216
|
-
ModernUIContribution = ( __decorate([( __param(0, IConfigurationService)), ( __param(1, IWorkbenchLayoutService))], ModernUIContribution));
|
|
217
|
-
registerWorkbenchContribution2(ModernUIContribution.ID, ModernUIContribution, WorkbenchPhase.BlockRestore);
|
|
218
|
-
|
|
219
|
-
export { ModernUIContribution };
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,255 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colorUtils';
|
|
3
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/baseColors';
|
|
4
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/chartsColors';
|
|
5
|
-
import { editorBackground } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/editorColors';
|
|
6
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/inputColors';
|
|
7
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/listColors';
|
|
8
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/menuColors';
|
|
9
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/minimapColors';
|
|
10
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/miscColors';
|
|
11
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/quickpickColors';
|
|
12
|
-
import '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/colors/searchColors';
|
|
13
|
-
import { registerThemingParticipant } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService';
|
|
14
|
-
import { TAB_ACTIVE_BACKGROUND, MODERN_EDITOR_TAB_ACTIVE_BACKGROUND, MODERN_TAB_ACTIVE_BACKGROUND, TAB_UNFOCUSED_ACTIVE_BACKGROUND, TAB_INACTIVE_BACKGROUND, MODERN_EDITOR_TAB_INACTIVE_BACKGROUND, TAB_UNFOCUSED_INACTIVE_BACKGROUND, TAB_HOVER_BACKGROUND, MODERN_EDITOR_TAB_HOVER_BACKGROUND, MODERN_TAB_HOVER_BACKGROUND, TAB_UNFOCUSED_HOVER_BACKGROUND, MODERN_EDITOR_TAB_ACTIVE_HOVER_BACKGROUND, MODERN_EDITOR_TAB_ACTIVE_ACTION_BACKGROUND, MODERN_EDITOR_TAB_HOVER_ACTION_BACKGROUND, MODERN_EDITOR_TAB_ACTIVE_HOVER_ACTION_BACKGROUND, TAB_ACTIVE_FOREGROUND, MODERN_EDITOR_TAB_ACTIVE_FOREGROUND, MODERN_TAB_ACTIVE_FOREGROUND, TAB_UNFOCUSED_ACTIVE_FOREGROUND, TAB_INACTIVE_FOREGROUND, TAB_UNFOCUSED_INACTIVE_FOREGROUND, TAB_HOVER_FOREGROUND, MODERN_EDITOR_TAB_HOVER_FOREGROUND, MODERN_TAB_HOVER_FOREGROUND, TAB_UNFOCUSED_HOVER_FOREGROUND, TAB_BORDER, TAB_LAST_PINNED_BORDER, TAB_ACTIVE_BORDER, TAB_UNFOCUSED_ACTIVE_BORDER, TAB_ACTIVE_BORDER_TOP, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, TAB_HOVER_BORDER, TAB_UNFOCUSED_HOVER_BORDER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
15
|
-
import { ColorThemeData } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/themes/common/colorThemeData';
|
|
16
|
-
|
|
17
|
-
function resolveLegacyTabColor(theme, legacyColorId, modernColorIds, ...relatedLegacyColorIds) {
|
|
18
|
-
if (( modernColorIds.some(id => theme.getColorCustomization(id)))) {
|
|
19
|
-
return undefined;
|
|
20
|
-
}
|
|
21
|
-
if (!theme.getColorCustomization(legacyColorId) && !( relatedLegacyColorIds.some(id => theme.getColorCustomization(id)))) {
|
|
22
|
-
return undefined;
|
|
23
|
-
}
|
|
24
|
-
return theme.getColor(legacyColorId);
|
|
25
|
-
}
|
|
26
|
-
function addColorVariable(declarations, name, color) {
|
|
27
|
-
if (color) {
|
|
28
|
-
declarations.push(`${name}: ${color};`);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
function flattenActionBackground(color, editorBackgroundColor) {
|
|
32
|
-
return editorBackgroundColor ? color.makeOpaque(editorBackgroundColor) : color;
|
|
33
|
-
}
|
|
34
|
-
registerThemingParticipant((theme, collector) => {
|
|
35
|
-
if (!(theme instanceof ColorThemeData)) {
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
const declarations = [];
|
|
39
|
-
const activeBackground = resolveLegacyTabColor(
|
|
40
|
-
theme,
|
|
41
|
-
TAB_ACTIVE_BACKGROUND,
|
|
42
|
-
[MODERN_EDITOR_TAB_ACTIVE_BACKGROUND, MODERN_TAB_ACTIVE_BACKGROUND]
|
|
43
|
-
);
|
|
44
|
-
const unfocusedActiveBackground = resolveLegacyTabColor(
|
|
45
|
-
theme,
|
|
46
|
-
TAB_UNFOCUSED_ACTIVE_BACKGROUND,
|
|
47
|
-
[MODERN_EDITOR_TAB_ACTIVE_BACKGROUND, MODERN_TAB_ACTIVE_BACKGROUND],
|
|
48
|
-
TAB_ACTIVE_BACKGROUND
|
|
49
|
-
);
|
|
50
|
-
const inactiveBackground = resolveLegacyTabColor(theme, TAB_INACTIVE_BACKGROUND, [MODERN_EDITOR_TAB_INACTIVE_BACKGROUND]);
|
|
51
|
-
const unfocusedInactiveBackground = resolveLegacyTabColor(
|
|
52
|
-
theme,
|
|
53
|
-
TAB_UNFOCUSED_INACTIVE_BACKGROUND,
|
|
54
|
-
[MODERN_EDITOR_TAB_INACTIVE_BACKGROUND],
|
|
55
|
-
TAB_INACTIVE_BACKGROUND
|
|
56
|
-
);
|
|
57
|
-
const hoverBackground = resolveLegacyTabColor(
|
|
58
|
-
theme,
|
|
59
|
-
TAB_HOVER_BACKGROUND,
|
|
60
|
-
[MODERN_EDITOR_TAB_HOVER_BACKGROUND, MODERN_TAB_HOVER_BACKGROUND]
|
|
61
|
-
);
|
|
62
|
-
const unfocusedHoverBackground = resolveLegacyTabColor(
|
|
63
|
-
theme,
|
|
64
|
-
TAB_UNFOCUSED_HOVER_BACKGROUND,
|
|
65
|
-
[MODERN_EDITOR_TAB_HOVER_BACKGROUND, MODERN_TAB_HOVER_BACKGROUND],
|
|
66
|
-
TAB_HOVER_BACKGROUND
|
|
67
|
-
);
|
|
68
|
-
const activeHoverBackground = resolveLegacyTabColor(theme, TAB_HOVER_BACKGROUND, [
|
|
69
|
-
MODERN_EDITOR_TAB_ACTIVE_HOVER_BACKGROUND,
|
|
70
|
-
MODERN_EDITOR_TAB_HOVER_BACKGROUND,
|
|
71
|
-
MODERN_TAB_HOVER_BACKGROUND
|
|
72
|
-
]);
|
|
73
|
-
const unfocusedActiveHoverBackground = resolveLegacyTabColor(theme, TAB_UNFOCUSED_HOVER_BACKGROUND, [
|
|
74
|
-
MODERN_EDITOR_TAB_ACTIVE_HOVER_BACKGROUND,
|
|
75
|
-
MODERN_EDITOR_TAB_HOVER_BACKGROUND,
|
|
76
|
-
MODERN_TAB_HOVER_BACKGROUND
|
|
77
|
-
], TAB_HOVER_BACKGROUND);
|
|
78
|
-
const editorBackgroundColor = theme.getColor(editorBackground);
|
|
79
|
-
const hasModernActiveActionBackground = !!theme.getColorCustomization(MODERN_EDITOR_TAB_ACTIVE_ACTION_BACKGROUND);
|
|
80
|
-
const hasModernHoverActionBackground = !!theme.getColorCustomization(MODERN_EDITOR_TAB_HOVER_ACTION_BACKGROUND);
|
|
81
|
-
const hasModernActiveHoverActionBackground = !!theme.getColorCustomization(MODERN_EDITOR_TAB_ACTIVE_HOVER_ACTION_BACKGROUND);
|
|
82
|
-
addColorVariable(declarations, "--modern-ui-editor-tab-active-background", activeBackground);
|
|
83
|
-
addColorVariable(
|
|
84
|
-
declarations,
|
|
85
|
-
"--modern-ui-editor-tab-unfocused-active-background",
|
|
86
|
-
unfocusedActiveBackground
|
|
87
|
-
);
|
|
88
|
-
addColorVariable(
|
|
89
|
-
declarations,
|
|
90
|
-
"--modern-ui-editor-tab-inactive-background",
|
|
91
|
-
inactiveBackground
|
|
92
|
-
);
|
|
93
|
-
addColorVariable(
|
|
94
|
-
declarations,
|
|
95
|
-
"--modern-ui-editor-tab-unfocused-inactive-background",
|
|
96
|
-
unfocusedInactiveBackground
|
|
97
|
-
);
|
|
98
|
-
addColorVariable(declarations, "--modern-ui-editor-tab-hover-background", hoverBackground);
|
|
99
|
-
addColorVariable(
|
|
100
|
-
declarations,
|
|
101
|
-
"--modern-ui-editor-tab-unfocused-hover-background",
|
|
102
|
-
unfocusedHoverBackground
|
|
103
|
-
);
|
|
104
|
-
addColorVariable(
|
|
105
|
-
declarations,
|
|
106
|
-
"--modern-ui-editor-tab-active-hover-background",
|
|
107
|
-
activeHoverBackground
|
|
108
|
-
);
|
|
109
|
-
addColorVariable(
|
|
110
|
-
declarations,
|
|
111
|
-
"--modern-ui-editor-tab-unfocused-active-hover-background",
|
|
112
|
-
unfocusedActiveHoverBackground
|
|
113
|
-
);
|
|
114
|
-
addColorVariable(
|
|
115
|
-
declarations,
|
|
116
|
-
"--modern-ui-editor-tab-active-foreground",
|
|
117
|
-
resolveLegacyTabColor(
|
|
118
|
-
theme,
|
|
119
|
-
TAB_ACTIVE_FOREGROUND,
|
|
120
|
-
[MODERN_EDITOR_TAB_ACTIVE_FOREGROUND, MODERN_TAB_ACTIVE_FOREGROUND]
|
|
121
|
-
)
|
|
122
|
-
);
|
|
123
|
-
addColorVariable(
|
|
124
|
-
declarations,
|
|
125
|
-
"--modern-ui-editor-tab-unfocused-active-foreground",
|
|
126
|
-
resolveLegacyTabColor(
|
|
127
|
-
theme,
|
|
128
|
-
TAB_UNFOCUSED_ACTIVE_FOREGROUND,
|
|
129
|
-
[MODERN_EDITOR_TAB_ACTIVE_FOREGROUND, MODERN_TAB_ACTIVE_FOREGROUND],
|
|
130
|
-
TAB_ACTIVE_FOREGROUND
|
|
131
|
-
)
|
|
132
|
-
);
|
|
133
|
-
addColorVariable(
|
|
134
|
-
declarations,
|
|
135
|
-
"--modern-ui-editor-tab-inactive-foreground",
|
|
136
|
-
resolveLegacyTabColor(theme, TAB_INACTIVE_FOREGROUND, [], TAB_ACTIVE_FOREGROUND)
|
|
137
|
-
);
|
|
138
|
-
addColorVariable(
|
|
139
|
-
declarations,
|
|
140
|
-
"--modern-ui-editor-tab-unfocused-inactive-foreground",
|
|
141
|
-
resolveLegacyTabColor(
|
|
142
|
-
theme,
|
|
143
|
-
TAB_UNFOCUSED_INACTIVE_FOREGROUND,
|
|
144
|
-
[],
|
|
145
|
-
TAB_INACTIVE_FOREGROUND,
|
|
146
|
-
TAB_ACTIVE_FOREGROUND
|
|
147
|
-
)
|
|
148
|
-
);
|
|
149
|
-
addColorVariable(
|
|
150
|
-
declarations,
|
|
151
|
-
"--modern-ui-editor-tab-hover-foreground",
|
|
152
|
-
resolveLegacyTabColor(
|
|
153
|
-
theme,
|
|
154
|
-
TAB_HOVER_FOREGROUND,
|
|
155
|
-
[MODERN_EDITOR_TAB_HOVER_FOREGROUND, MODERN_TAB_HOVER_FOREGROUND]
|
|
156
|
-
)
|
|
157
|
-
);
|
|
158
|
-
addColorVariable(
|
|
159
|
-
declarations,
|
|
160
|
-
"--modern-ui-editor-tab-unfocused-hover-foreground",
|
|
161
|
-
resolveLegacyTabColor(
|
|
162
|
-
theme,
|
|
163
|
-
TAB_UNFOCUSED_HOVER_FOREGROUND,
|
|
164
|
-
[MODERN_EDITOR_TAB_HOVER_FOREGROUND, MODERN_TAB_HOVER_FOREGROUND],
|
|
165
|
-
TAB_HOVER_FOREGROUND
|
|
166
|
-
)
|
|
167
|
-
);
|
|
168
|
-
addColorVariable(
|
|
169
|
-
declarations,
|
|
170
|
-
"--modern-ui-editor-tab-border",
|
|
171
|
-
resolveLegacyTabColor(theme, TAB_BORDER, [])
|
|
172
|
-
);
|
|
173
|
-
addColorVariable(
|
|
174
|
-
declarations,
|
|
175
|
-
"--modern-ui-editor-tab-last-pinned-border",
|
|
176
|
-
resolveLegacyTabColor(theme, TAB_LAST_PINNED_BORDER, [])
|
|
177
|
-
);
|
|
178
|
-
addColorVariable(
|
|
179
|
-
declarations,
|
|
180
|
-
"--modern-ui-editor-tab-active-border",
|
|
181
|
-
resolveLegacyTabColor(theme, TAB_ACTIVE_BORDER, [])
|
|
182
|
-
);
|
|
183
|
-
addColorVariable(
|
|
184
|
-
declarations,
|
|
185
|
-
"--modern-ui-editor-tab-unfocused-active-border",
|
|
186
|
-
resolveLegacyTabColor(theme, TAB_UNFOCUSED_ACTIVE_BORDER, [], TAB_ACTIVE_BORDER)
|
|
187
|
-
);
|
|
188
|
-
addColorVariable(
|
|
189
|
-
declarations,
|
|
190
|
-
"--modern-ui-editor-tab-active-border-top",
|
|
191
|
-
resolveLegacyTabColor(theme, TAB_ACTIVE_BORDER_TOP, [])
|
|
192
|
-
);
|
|
193
|
-
addColorVariable(
|
|
194
|
-
declarations,
|
|
195
|
-
"--modern-ui-editor-tab-unfocused-active-border-top",
|
|
196
|
-
resolveLegacyTabColor(theme, TAB_UNFOCUSED_ACTIVE_BORDER_TOP, [], TAB_ACTIVE_BORDER_TOP)
|
|
197
|
-
);
|
|
198
|
-
addColorVariable(
|
|
199
|
-
declarations,
|
|
200
|
-
"--modern-ui-editor-tab-hover-border",
|
|
201
|
-
resolveLegacyTabColor(theme, TAB_HOVER_BORDER, [])
|
|
202
|
-
);
|
|
203
|
-
addColorVariable(
|
|
204
|
-
declarations,
|
|
205
|
-
"--modern-ui-editor-tab-unfocused-hover-border",
|
|
206
|
-
resolveLegacyTabColor(theme, TAB_UNFOCUSED_HOVER_BORDER, [], TAB_HOVER_BORDER)
|
|
207
|
-
);
|
|
208
|
-
if (activeBackground && !hasModernActiveActionBackground) {
|
|
209
|
-
addColorVariable(
|
|
210
|
-
declarations,
|
|
211
|
-
"--modern-ui-editor-tab-action-active-background",
|
|
212
|
-
flattenActionBackground(activeBackground, editorBackgroundColor)
|
|
213
|
-
);
|
|
214
|
-
}
|
|
215
|
-
if (unfocusedActiveBackground && !hasModernActiveActionBackground) {
|
|
216
|
-
addColorVariable(
|
|
217
|
-
declarations,
|
|
218
|
-
"--modern-ui-editor-tab-action-unfocused-active-background",
|
|
219
|
-
flattenActionBackground(unfocusedActiveBackground, editorBackgroundColor)
|
|
220
|
-
);
|
|
221
|
-
}
|
|
222
|
-
if (hoverBackground && !hasModernHoverActionBackground) {
|
|
223
|
-
addColorVariable(
|
|
224
|
-
declarations,
|
|
225
|
-
"--modern-ui-editor-tab-action-hover-background",
|
|
226
|
-
flattenActionBackground(hoverBackground, editorBackgroundColor)
|
|
227
|
-
);
|
|
228
|
-
}
|
|
229
|
-
if (unfocusedHoverBackground && !hasModernHoverActionBackground) {
|
|
230
|
-
addColorVariable(
|
|
231
|
-
declarations,
|
|
232
|
-
"--modern-ui-editor-tab-action-unfocused-hover-background",
|
|
233
|
-
flattenActionBackground(unfocusedHoverBackground, editorBackgroundColor)
|
|
234
|
-
);
|
|
235
|
-
}
|
|
236
|
-
if (activeHoverBackground && !hasModernActiveHoverActionBackground) {
|
|
237
|
-
addColorVariable(
|
|
238
|
-
declarations,
|
|
239
|
-
"--modern-ui-editor-tab-action-active-hover-background",
|
|
240
|
-
flattenActionBackground(activeHoverBackground, editorBackgroundColor)
|
|
241
|
-
);
|
|
242
|
-
}
|
|
243
|
-
if (unfocusedActiveHoverBackground && !hasModernActiveHoverActionBackground) {
|
|
244
|
-
addColorVariable(
|
|
245
|
-
declarations,
|
|
246
|
-
"--modern-ui-editor-tab-action-unfocused-active-hover-background",
|
|
247
|
-
flattenActionBackground(unfocusedActiveHoverBackground, editorBackgroundColor)
|
|
248
|
-
);
|
|
249
|
-
}
|
|
250
|
-
if (declarations.length > 0) {
|
|
251
|
-
collector.addRule(
|
|
252
|
-
`.modern-ui-tabs.monaco-workbench.monaco-workbench { ${declarations.join("\n")} }`
|
|
253
|
-
);
|
|
254
|
-
}
|
|
255
|
-
});
|