@codingame/monaco-vscode-view-title-bar-service-override 36.2.6 → 37.1.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 +2 -2
- package/vscode/src/vs/workbench/browser/parts/titlebar/commandCenterControl.js +8 -8
- package/vscode/src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css +42 -5
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.d.ts +8 -7
- package/vscode/src/vs/workbench/browser/parts/titlebar/titlebarPart.js +73 -49
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-view-title-bar-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - view-title-bar service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.1.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -19,10 +19,10 @@ import { IQuickInputService } from '@codingame/monaco-vscode-api/vscode/vs/platf
|
|
|
19
19
|
import { IEditorGroupsService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/editor/common/editorGroupsService.service';
|
|
20
20
|
import { IHoverService } from '@codingame/monaco-vscode-api/vscode/vs/platform/hover/browser/hover.service';
|
|
21
21
|
import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/configuration/common/configuration.service';
|
|
22
|
+
import { ChatAIDisabledSettingId } from '@codingame/monaco-vscode-api/vscode/vs/platform/chat/common/chatSettings';
|
|
22
23
|
import { autorun } from '@codingame/monaco-vscode-api/vscode/vs/base/common/observableInternal/reactions/autorun';
|
|
23
24
|
|
|
24
25
|
var CommandCenterCenterViewItem_1;
|
|
25
|
-
const AI_DISABLED_SETTING = "chat.disableAIFeatures";
|
|
26
26
|
const AGENT_STATUS_ENABLED_SETTING = "chat.agentsControl.enabled";
|
|
27
27
|
let CommandCenterControl = class CommandCenterControl {
|
|
28
28
|
constructor(windowTitle, hoverDelegate, instantiationService, quickInputService) {
|
|
@@ -154,7 +154,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
154
154
|
container.classList.toggle("command-center-quick-pick");
|
|
155
155
|
container.role = "button";
|
|
156
156
|
container.setAttribute("aria-description", this.getTooltip());
|
|
157
|
-
const aiFeaturesDisabled = that._configurationService.getValue(
|
|
157
|
+
const aiFeaturesDisabled = that._configurationService.getValue(ChatAIDisabledSettingId) === true;
|
|
158
158
|
const aiCustomizationsDisabled = that._configurationService.getValue("disableAICustomizations") === true || that._configurationService.getValue("workbench.disableAICustomizations") === true;
|
|
159
159
|
const forcedHidden = aiFeaturesDisabled && aiCustomizationsDisabled;
|
|
160
160
|
const agentControlValue = that._configurationService.getValue(AGENT_STATUS_ENABLED_SETTING);
|
|
@@ -208,13 +208,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
208
208
|
label = that._windowTitle.fileName ?? label;
|
|
209
209
|
}
|
|
210
210
|
if (!label) {
|
|
211
|
-
label = ( localize(
|
|
211
|
+
label = ( localize(4216, "Search"));
|
|
212
212
|
}
|
|
213
213
|
if (prefix) {
|
|
214
|
-
label = ( localize(
|
|
214
|
+
label = ( localize(4217, "{0} {1}", prefix, label));
|
|
215
215
|
}
|
|
216
216
|
if (suffix) {
|
|
217
|
-
label = ( localize(
|
|
217
|
+
label = ( localize(4218, "{0} {1}", label, suffix));
|
|
218
218
|
}
|
|
219
219
|
return label.replaceAll(/\r\n|\r|\n/g, "⏎");
|
|
220
220
|
}
|
|
@@ -235,13 +235,13 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
235
235
|
getTooltip() {
|
|
236
236
|
const kb = this._keybindingService.lookupKeybinding(this.action.id)?.getLabel();
|
|
237
237
|
const title = kb ? ( localize(
|
|
238
|
-
|
|
238
|
+
4219,
|
|
239
239
|
"Search {0} ({1}) — {2}",
|
|
240
240
|
this._windowTitle.workspaceName,
|
|
241
241
|
kb,
|
|
242
242
|
this._windowTitle.value
|
|
243
243
|
)) : ( localize(
|
|
244
|
-
|
|
244
|
+
4220,
|
|
245
245
|
"Search {0} — {1}",
|
|
246
246
|
this._windowTitle.workspaceName,
|
|
247
247
|
this._windowTitle.value
|
|
@@ -252,7 +252,7 @@ let CommandCenterCenterViewItem = class CommandCenterCenterViewItem extends Base
|
|
|
252
252
|
CommandCenterCenterViewItem = CommandCenterCenterViewItem_1 = ( __decorate([( __param(3, IHoverService)), ( __param(4, IKeybindingService)), ( __param(5, IInstantiationService)), ( __param(6, IEditorGroupsService)), ( __param(7, IConfigurationService))], CommandCenterCenterViewItem));
|
|
253
253
|
MenuRegistry.appendMenuItem(MenuId.CommandCenter, {
|
|
254
254
|
submenu: MenuId.CommandCenterCenter,
|
|
255
|
-
title: ( localize(
|
|
255
|
+
title: ( localize(4221, "Command Center")),
|
|
256
256
|
icon: Codicon.shield,
|
|
257
257
|
order: 101
|
|
258
258
|
});
|
|
@@ -397,19 +397,35 @@
|
|
|
397
397
|
color: white;
|
|
398
398
|
}
|
|
399
399
|
|
|
400
|
-
/*
|
|
401
|
-
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container
|
|
400
|
+
/* Optional title bar toolbars */
|
|
401
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container,
|
|
402
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container {
|
|
402
403
|
z-index: 2500;
|
|
403
404
|
-webkit-app-region: no-drag;
|
|
405
|
+
}
|
|
406
|
+
|
|
407
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container {
|
|
404
408
|
margin-right: auto;
|
|
405
409
|
}
|
|
406
410
|
|
|
407
|
-
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .
|
|
411
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container {
|
|
412
|
+
margin-left: auto;
|
|
413
|
+
margin-right: var(--vscode-spacing-size40);
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container:not(.has-no-actions):not(.overflowing) + .update-toolbar-container,
|
|
417
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container:not(.has-no-actions):not(.overflowing) + .action-toolbar-container {
|
|
418
|
+
margin-left: 0;
|
|
419
|
+
}
|
|
420
|
+
|
|
421
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.has-no-actions,
|
|
422
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container.has-no-actions {
|
|
408
423
|
display: none;
|
|
409
424
|
}
|
|
410
425
|
|
|
411
426
|
/* Hidden when the title bar is too narrow to fit it without pushing the window controls off-screen (#303222). */
|
|
412
|
-
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.overflowing
|
|
427
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .center-adjacent-toolbar-container.overflowing,
|
|
428
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container.overflowing {
|
|
413
429
|
display: none;
|
|
414
430
|
}
|
|
415
431
|
|
|
@@ -419,6 +435,7 @@
|
|
|
419
435
|
padding-right: 4px;
|
|
420
436
|
flex-grow: 0;
|
|
421
437
|
flex-shrink: 0;
|
|
438
|
+
color: var(--vscode-titleBar-activeForeground);
|
|
422
439
|
text-align: center;
|
|
423
440
|
position: relative;
|
|
424
441
|
z-index: 2500;
|
|
@@ -426,11 +443,17 @@
|
|
|
426
443
|
height: 100%;
|
|
427
444
|
}
|
|
428
445
|
|
|
446
|
+
.monaco-workbench .part.titlebar.inactive > .titlebar-container > .titlebar-right > .action-toolbar-container {
|
|
447
|
+
color: var(--vscode-titleBar-inactiveForeground);
|
|
448
|
+
}
|
|
449
|
+
|
|
429
450
|
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container {
|
|
430
451
|
margin-left: auto;
|
|
431
452
|
}
|
|
432
453
|
|
|
433
|
-
.monaco-workbench.mac:not(.web) .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container
|
|
454
|
+
.monaco-workbench.mac:not(.web) .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container,
|
|
455
|
+
.monaco-workbench.mac:not(.web) .part.titlebar > .titlebar-container > .titlebar-right > .update-toolbar-container {
|
|
456
|
+
position: relative;
|
|
434
457
|
right: 8px;
|
|
435
458
|
}
|
|
436
459
|
|
|
@@ -502,3 +525,17 @@
|
|
|
502
525
|
border-radius: 16px;
|
|
503
526
|
text-align: center;
|
|
504
527
|
}
|
|
528
|
+
|
|
529
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container .monaco-action-bar .action-item.icon .badge.compact.progress-badge .badge-content {
|
|
530
|
+
width: 12px;
|
|
531
|
+
padding: 0;
|
|
532
|
+
border-radius: var(--vscode-cornerRadius-circle);
|
|
533
|
+
display: flex;
|
|
534
|
+
align-items: center;
|
|
535
|
+
justify-content: center;
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
.monaco-workbench .part.titlebar > .titlebar-container > .titlebar-right > .action-toolbar-container .monaco-action-bar .action-item.icon .badge.compact.progress-badge .badge-content::before {
|
|
539
|
+
width: 12px;
|
|
540
|
+
height: 12px;
|
|
541
|
+
}
|
|
@@ -65,6 +65,7 @@ export declare class BrowserTitleService extends MultiWindowParts<BrowserTitleba
|
|
|
65
65
|
get windowTitle(): WindowTitle;
|
|
66
66
|
}
|
|
67
67
|
export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
68
|
+
private readonly targetWindow;
|
|
68
69
|
private readonly editorGroupsContainer;
|
|
69
70
|
private readonly contextMenuService;
|
|
70
71
|
protected readonly configurationService: IConfigurationService;
|
|
@@ -91,6 +92,7 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
91
92
|
private centerContent;
|
|
92
93
|
private rightContent;
|
|
93
94
|
protected readonly customMenubar: MutableDisposable<CustomMenubarControl>;
|
|
95
|
+
private readonly customMenubarDisposables;
|
|
94
96
|
protected appIcon: HTMLElement | undefined;
|
|
95
97
|
private appIconBadge;
|
|
96
98
|
protected menubar?: HTMLElement;
|
|
@@ -101,6 +103,9 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
101
103
|
private actionToolBarElement;
|
|
102
104
|
private readonly centerAdjacentToolBarDisposable;
|
|
103
105
|
private centerAdjacentToolBarElement;
|
|
106
|
+
private readonly updateToolBarDisposable;
|
|
107
|
+
private updateToolBarElement;
|
|
108
|
+
private titleBarToolBarOverflowScheduler;
|
|
104
109
|
private globalToolbarMenu;
|
|
105
110
|
private layoutToolbarMenu;
|
|
106
111
|
private readonly globalToolbarMenuDisposables;
|
|
@@ -110,7 +115,7 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
110
115
|
private readonly hoverDelegate;
|
|
111
116
|
private readonly titleDisposables;
|
|
112
117
|
private titleBarStyle;
|
|
113
|
-
private
|
|
118
|
+
private activeWindowId;
|
|
114
119
|
private readonly isAuxiliary;
|
|
115
120
|
private isCompact;
|
|
116
121
|
private readonly isCompactContextKey;
|
|
@@ -118,8 +123,6 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
118
123
|
protected readonly instantiationService: IInstantiationService;
|
|
119
124
|
constructor(id: string, targetWindow: CodeWindow, editorGroupsContainer: IEditorGroupsContainer, contextMenuService: IContextMenuService, configurationService: IConfigurationService, environmentService: IBrowserWorkbenchEnvironmentService, instantiationService: IInstantiationService, themeService: IThemeService, storageService: IStorageService, layoutService: IWorkbenchLayoutService, contextKeyService: IContextKeyService, hostService: IHostService, editorService: IEditorService, menuService: IMenuService, keybindingService: IKeybindingService, actionViewItemService: IActionViewItemService);
|
|
120
125
|
private registerListeners;
|
|
121
|
-
private onBlur;
|
|
122
|
-
private onFocus;
|
|
123
126
|
private onEditorPartConfigurationChange;
|
|
124
127
|
protected onConfigurationChanged(event: IConfigurationChangeEvent): void;
|
|
125
128
|
private recreateTitle;
|
|
@@ -149,11 +152,9 @@ export declare class BrowserTitlebarPart extends Part implements ITitlebarPart {
|
|
|
149
152
|
get preventZoom(): boolean;
|
|
150
153
|
layout(width: number, height: number): void;
|
|
151
154
|
/**
|
|
152
|
-
* Hides
|
|
153
|
-
* content—most notably the trailing window controls—off-screen as the window is collapsed horizontally (#303222).
|
|
154
|
-
* Overflow is measured against actual rendered widths so the toolbar stays visible whenever it fits.
|
|
155
|
+
* Hides optional title bar toolbars when showing them would push the trailing window controls off-screen (#303222).
|
|
155
156
|
*/
|
|
156
|
-
private
|
|
157
|
+
private updateTitleBarToolBarOverflow;
|
|
157
158
|
private updateLayout;
|
|
158
159
|
focus(): void;
|
|
159
160
|
toJSON(): object;
|
|
@@ -12,10 +12,10 @@ import { IConfigurationService } from '@codingame/monaco-vscode-api/vscode/vs/pl
|
|
|
12
12
|
import { DisposableStore, MutableDisposable } from '@codingame/monaco-vscode-api/vscode/vs/base/common/lifecycle';
|
|
13
13
|
import { IBrowserWorkbenchEnvironmentService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/services/environment/browser/environmentService.service';
|
|
14
14
|
import { IThemeService } from '@codingame/monaco-vscode-api/vscode/vs/platform/theme/common/themeService.service';
|
|
15
|
-
import { TITLE_BAR_INACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_BACKGROUND,
|
|
15
|
+
import { WORKBENCH_BACKGROUND, TITLE_BAR_INACTIVE_BACKGROUND, TITLE_BAR_ACTIVE_BACKGROUND, MODERN_UI_INACTIVE_SHELL_BACKGROUND, MODERN_UI_SHELL_BACKGROUND, TITLE_BAR_INACTIVE_FOREGROUND, TITLE_BAR_ACTIVE_FOREGROUND, TITLE_BAR_BORDER } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/theme';
|
|
16
16
|
import { isWeb, isMacintosh, isWindows, isLinux, isNative, platformLocale } from '@codingame/monaco-vscode-api/vscode/vs/base/common/platform';
|
|
17
17
|
import { Color } from '@codingame/monaco-vscode-api/vscode/vs/base/common/color';
|
|
18
|
-
import { getActiveDocument, $, getWindow,
|
|
18
|
+
import { getActiveDocument, $, getWindow, append, AnimationFrameScheduler, prepend, addDisposableListener, EventType, EventHelper, isHTMLElement, isAncestor, reset, getWindowId, Dimension } from '@codingame/monaco-vscode-api/vscode/vs/base/browser/dom';
|
|
19
19
|
import { CustomMenubarControl } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/parts/titlebar/menubarControl';
|
|
20
20
|
import { IInstantiationService } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
21
21
|
import { Event, Emitter } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
@@ -52,6 +52,7 @@ import { CommandsRegistry } from '@codingame/monaco-vscode-api/vscode/vs/platfor
|
|
|
52
52
|
import { safeIntl } from '@codingame/monaco-vscode-api/vscode/vs/base/common/date';
|
|
53
53
|
import { TitleBarVisibleContext, IsCompactTitleBarContext } from '@codingame/monaco-vscode-api/vscode/vs/workbench/common/contextkeys';
|
|
54
54
|
import { ServiceCollection } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/serviceCollection';
|
|
55
|
+
import { workbenchMenuCloseAnimation, WORKBENCH_MENU_MOTION_CLASS } from '@codingame/monaco-vscode-api/vscode/vs/workbench/browser/actions/menuMotion';
|
|
55
56
|
import { AnchorAlignment } from '@codingame/monaco-vscode-api/vscode/vs/base/common/layout';
|
|
56
57
|
|
|
57
58
|
var AuxiliaryBrowserTitlebarPart_1;
|
|
@@ -77,7 +78,7 @@ let BrowserTitleService = class BrowserTitleService extends MultiWindowParts {
|
|
|
77
78
|
constructor() {
|
|
78
79
|
super({
|
|
79
80
|
id: `workbench.action.focusTitleBar`,
|
|
80
|
-
title: ( localize2(
|
|
81
|
+
title: ( localize2(4258, "Focus Title Bar")),
|
|
81
82
|
category: Categories.View,
|
|
82
83
|
f1: true,
|
|
83
84
|
precondition: TitleBarVisibleContext
|
|
@@ -202,6 +203,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
202
203
|
super(id, {
|
|
203
204
|
hasTitle: false
|
|
204
205
|
}, themeService, storageService, layoutService);
|
|
206
|
+
this.targetWindow = targetWindow;
|
|
205
207
|
this.editorGroupsContainer = editorGroupsContainer;
|
|
206
208
|
this.contextMenuService = contextMenuService;
|
|
207
209
|
this.configurationService = configurationService;
|
|
@@ -219,15 +221,16 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
219
221
|
this._onWillDispose = this._register(( new Emitter()));
|
|
220
222
|
this.onWillDispose = this._onWillDispose.event;
|
|
221
223
|
this.customMenubar = this._register(( new MutableDisposable()));
|
|
224
|
+
this.customMenubarDisposables = this._register(( new DisposableStore()));
|
|
222
225
|
this.actionToolBarDisposable = this._register(( new DisposableStore()));
|
|
223
226
|
this.editorActionsChangeDisposable = this._register(( new DisposableStore()));
|
|
224
227
|
this.centerAdjacentToolBarDisposable = this._register(( new DisposableStore()));
|
|
228
|
+
this.updateToolBarDisposable = this._register(( new DisposableStore()));
|
|
225
229
|
this.globalToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
226
230
|
this.editorToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
227
231
|
this.layoutToolbarMenuDisposables = this._register(( new DisposableStore()));
|
|
228
232
|
this.activityToolbarDisposables = this._register(( new DisposableStore()));
|
|
229
233
|
this.titleDisposables = this._register(( new DisposableStore()));
|
|
230
|
-
this.isInactive = false;
|
|
231
234
|
this.isCompact = false;
|
|
232
235
|
const scopedEditorService = editorService.createScoped(editorGroupsContainer, this._store);
|
|
233
236
|
this.instantiationService = this._register(instantiationService.createChild(( new ServiceCollection([IEditorService, scopedEditorService]))));
|
|
@@ -236,15 +239,14 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
236
239
|
this.titleBarStyle = getTitleBarStyle(this.configurationService);
|
|
237
240
|
this.windowTitle = this._register(this.instantiationService.createInstance(WindowTitle, targetWindow));
|
|
238
241
|
this.hoverDelegate = this._register(createInstantHoverDelegate());
|
|
239
|
-
this.registerListeners(
|
|
242
|
+
this.registerListeners();
|
|
240
243
|
}
|
|
241
|
-
registerListeners(
|
|
242
|
-
this._register(
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
);
|
|
244
|
+
registerListeners() {
|
|
245
|
+
this._register(this.hostService.onDidChangeFocus(() => this.updateStyles()));
|
|
246
|
+
this._register(this.hostService.onDidChangeActiveWindow(windowId => {
|
|
247
|
+
this.activeWindowId = windowId;
|
|
248
|
+
this.updateStyles();
|
|
249
|
+
}));
|
|
248
250
|
this._register(
|
|
249
251
|
this.configurationService.onDidChangeConfiguration(e => this.onConfigurationChanged(e))
|
|
250
252
|
);
|
|
@@ -252,14 +254,6 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
252
254
|
this.editorGroupsContainer.onDidChangeEditorPartOptions(e => this.onEditorPartConfigurationChange(e))
|
|
253
255
|
);
|
|
254
256
|
}
|
|
255
|
-
onBlur() {
|
|
256
|
-
this.isInactive = true;
|
|
257
|
-
this.updateStyles();
|
|
258
|
-
}
|
|
259
|
-
onFocus() {
|
|
260
|
-
this.isInactive = false;
|
|
261
|
-
this.updateStyles();
|
|
262
|
-
}
|
|
263
257
|
onEditorPartConfigurationChange(
|
|
264
258
|
{
|
|
265
259
|
oldPartOptions,
|
|
@@ -277,6 +271,9 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
277
271
|
}
|
|
278
272
|
}
|
|
279
273
|
onConfigurationChanged(event) {
|
|
274
|
+
if (event.affectsConfiguration(LayoutSettings.MODERN_UI)) {
|
|
275
|
+
this.updateStyles();
|
|
276
|
+
}
|
|
280
277
|
if (!this.isAuxiliary && !hasNativeMenu(this.configurationService, this.titleBarStyle) && (!isMacintosh || isWeb)) {
|
|
281
278
|
if (event.affectsConfiguration(MenuSettings.MenuBarVisibility)) {
|
|
282
279
|
if (this.currentMenubarVisibility === "compact") {
|
|
@@ -318,16 +315,16 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
318
315
|
if (this.menubar) {
|
|
319
316
|
return;
|
|
320
317
|
}
|
|
321
|
-
|
|
318
|
+
const customMenubar = this.instantiationService.createInstance(CustomMenubarControl);
|
|
319
|
+
this.customMenubar.value = customMenubar;
|
|
322
320
|
this.menubar = append(this.leftContent, $("div.menubar"));
|
|
323
321
|
this.menubar.setAttribute("role", "menubar");
|
|
324
|
-
this.
|
|
325
|
-
|
|
326
|
-
);
|
|
327
|
-
this.customMenubar.value.create(this.menubar);
|
|
322
|
+
this.customMenubarDisposables.add(customMenubar.onVisibilityChange(e => this.onMenubarVisibilityChanged(e)));
|
|
323
|
+
customMenubar.create(this.menubar);
|
|
328
324
|
}
|
|
329
325
|
uninstallMenubar() {
|
|
330
|
-
this.
|
|
326
|
+
this.customMenubarDisposables.clear();
|
|
327
|
+
this.customMenubar.clear();
|
|
331
328
|
this.menubar?.remove();
|
|
332
329
|
this.menubar = undefined;
|
|
333
330
|
this.onMenubarVisibilityChanged(false);
|
|
@@ -349,6 +346,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
349
346
|
createContentArea(parent) {
|
|
350
347
|
this.element = parent;
|
|
351
348
|
this.rootContainer = append(parent, $(".titlebar-container"));
|
|
349
|
+
this.titleBarToolBarOverflowScheduler = this._register(( new AnimationFrameScheduler(this.rootContainer, () => this.updateTitleBarToolBarOverflow())));
|
|
352
350
|
this.leftContent = append(this.rootContainer, $(".titlebar-left"));
|
|
353
351
|
this.centerContent = append(this.rootContainer, $(".titlebar-center"));
|
|
354
352
|
this.rightContent = append(this.rootContainer, $(".titlebar-right"));
|
|
@@ -379,7 +377,25 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
379
377
|
}
|
|
380
378
|
));
|
|
381
379
|
this.centerAdjacentToolBarDisposable.add(
|
|
382
|
-
centerAdjacentToolBar.onDidChangeMenuItems(() => this.
|
|
380
|
+
centerAdjacentToolBar.onDidChangeMenuItems(() => this.titleBarToolBarOverflowScheduler.schedule())
|
|
381
|
+
);
|
|
382
|
+
}
|
|
383
|
+
{
|
|
384
|
+
const updateToolBarElement = append(this.rightContent, $("div.update-toolbar-container"));
|
|
385
|
+
this.updateToolBarElement = updateToolBarElement;
|
|
386
|
+
const updateToolBar = this.updateToolBarDisposable.add(
|
|
387
|
+
this.instantiationService.createInstance(MenuWorkbenchToolBar, updateToolBarElement, MenuId.TitleBarUpdate, {
|
|
388
|
+
contextMenu: MenuId.TitleBarContext,
|
|
389
|
+
hiddenItemStrategy: HiddenItemStrategy.NoHide,
|
|
390
|
+
toolbarOptions: {
|
|
391
|
+
primaryGroup: () => true
|
|
392
|
+
},
|
|
393
|
+
actionViewItemProvider: (action, options) => createActionViewItem(this.instantiationService, action, options),
|
|
394
|
+
hoverDelegate: this.hoverDelegate
|
|
395
|
+
})
|
|
396
|
+
);
|
|
397
|
+
this.updateToolBarDisposable.add(
|
|
398
|
+
updateToolBar.onDidChangeMenuItems(() => this.titleBarToolBarOverflowScheduler.schedule())
|
|
383
399
|
);
|
|
384
400
|
}
|
|
385
401
|
{
|
|
@@ -508,7 +524,7 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
508
524
|
this.instantiationService.createInstance(WorkbenchToolBar, this.actionToolBarElement, {
|
|
509
525
|
contextMenu: MenuId.TitleBarContext,
|
|
510
526
|
orientation: ActionsOrientation.HORIZONTAL,
|
|
511
|
-
ariaLabel: ( localize(
|
|
527
|
+
ariaLabel: ( localize(4259, "Title actions")),
|
|
512
528
|
getKeyBinding: action => this.getKeybinding(action),
|
|
513
529
|
overflowBehavior: {
|
|
514
530
|
maxItems: 12,
|
|
@@ -519,6 +535,8 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
519
535
|
]
|
|
520
536
|
},
|
|
521
537
|
anchorAlignmentProvider: () => AnchorAlignment.RIGHT,
|
|
538
|
+
dropdownMenuClassName: WORKBENCH_MENU_MOTION_CLASS,
|
|
539
|
+
dropdownMenuCloseAnimation: workbenchMenuCloseAnimation,
|
|
522
540
|
telemetrySource: "titlePart",
|
|
523
541
|
highlightToggledItems: this.isAuxiliary,
|
|
524
542
|
actionViewItemProvider: (action, options) => this.actionViewItemProvider(action, options),
|
|
@@ -641,18 +659,26 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
641
659
|
updateStyles() {
|
|
642
660
|
super.updateStyles();
|
|
643
661
|
if (this.element) {
|
|
644
|
-
|
|
662
|
+
const isWindowActive = this.activeWindowId === undefined ? this.targetWindow.document.hasFocus() : this.activeWindowId === this.targetWindow.vscodeWindowId;
|
|
663
|
+
const isInactive = !this.hostService.hasFocus || !isWindowActive;
|
|
664
|
+
if (isInactive) {
|
|
645
665
|
this.element.classList.add("inactive");
|
|
646
666
|
} else {
|
|
647
667
|
this.element.classList.remove("inactive");
|
|
648
668
|
}
|
|
669
|
+
const makeOpaque = (color, theme) => {
|
|
670
|
+
return color.isOpaque() ? color : color.makeOpaque(WORKBENCH_BACKGROUND(theme));
|
|
671
|
+
};
|
|
649
672
|
const titleBackground = this.getColor(
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
673
|
+
isInactive ? TITLE_BAR_INACTIVE_BACKGROUND : TITLE_BAR_ACTIVE_BACKGROUND,
|
|
674
|
+
makeOpaque
|
|
675
|
+
) || this.getColor(TITLE_BAR_ACTIVE_BACKGROUND, makeOpaque) || "";
|
|
676
|
+
const shellBackground = this.getColor(
|
|
677
|
+
isInactive ? MODERN_UI_INACTIVE_SHELL_BACKGROUND : MODERN_UI_SHELL_BACKGROUND,
|
|
678
|
+
makeOpaque
|
|
679
|
+
) || this.getColor(MODERN_UI_SHELL_BACKGROUND, makeOpaque) || titleBackground;
|
|
655
680
|
this.element.style.backgroundColor = titleBackground;
|
|
681
|
+
this.layoutService.getContainer(getWindow(this.element)).style.setProperty("--modern-ui-shell-background", shellBackground);
|
|
656
682
|
if (this.appIconBadge) {
|
|
657
683
|
this.appIconBadge.style.backgroundColor = titleBackground;
|
|
658
684
|
}
|
|
@@ -661,11 +687,9 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
661
687
|
} else {
|
|
662
688
|
this.element.classList.remove("light");
|
|
663
689
|
}
|
|
664
|
-
const titleForeground = this.getColor(
|
|
665
|
-
this.isInactive ? TITLE_BAR_INACTIVE_FOREGROUND : TITLE_BAR_ACTIVE_FOREGROUND
|
|
666
|
-
);
|
|
690
|
+
const titleForeground = this.getColor(isInactive ? TITLE_BAR_INACTIVE_FOREGROUND : TITLE_BAR_ACTIVE_FOREGROUND);
|
|
667
691
|
this.element.style.color = titleForeground || "";
|
|
668
|
-
const titleBorder = this.getColor(TITLE_BAR_BORDER);
|
|
692
|
+
const titleBorder = !this.isAuxiliary && this.configurationService.getValue(LayoutSettings.MODERN_UI) === true ? undefined : this.getColor(TITLE_BAR_BORDER);
|
|
669
693
|
this.element.style.borderBottom = titleBorder ? `1px solid ${titleBorder}` : "";
|
|
670
694
|
}
|
|
671
695
|
}
|
|
@@ -712,20 +736,20 @@ let BrowserTitlebarPart = class BrowserTitlebarPart extends Part {
|
|
|
712
736
|
layout(width, height) {
|
|
713
737
|
this.updateLayout(( new Dimension(width, height)));
|
|
714
738
|
super.layoutContents(width, height);
|
|
715
|
-
this.
|
|
716
|
-
}
|
|
717
|
-
|
|
718
|
-
const
|
|
719
|
-
|
|
739
|
+
this.titleBarToolBarOverflowScheduler.schedule();
|
|
740
|
+
}
|
|
741
|
+
updateTitleBarToolBarOverflow() {
|
|
742
|
+
const centerAdjacentToolBarElement = this.centerAdjacentToolBarElement?.classList.contains("has-no-actions") ? undefined : this.centerAdjacentToolBarElement;
|
|
743
|
+
const updateToolBarElement = this.updateToolBarElement?.classList.contains("has-no-actions") ? undefined : this.updateToolBarElement;
|
|
744
|
+
this.centerAdjacentToolBarElement?.classList.remove("overflowing");
|
|
745
|
+
this.updateToolBarElement?.classList.remove("overflowing");
|
|
746
|
+
if (this.rootContainer.scrollWidth <= this.rootContainer.clientWidth) {
|
|
720
747
|
return;
|
|
721
748
|
}
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
749
|
+
centerAdjacentToolBarElement?.classList.add("overflowing");
|
|
750
|
+
if (this.rootContainer.scrollWidth > this.rootContainer.clientWidth) {
|
|
751
|
+
updateToolBarElement?.classList.add("overflowing");
|
|
725
752
|
}
|
|
726
|
-
element.classList.remove("overflowing");
|
|
727
|
-
const overflows = this.rootContainer.scrollWidth > this.rootContainer.clientWidth;
|
|
728
|
-
element.classList.toggle("overflowing", overflows);
|
|
729
753
|
}
|
|
730
754
|
updateLayout(dimension) {
|
|
731
755
|
this.lastLayoutDimensions = dimension;
|