Skip to content

Commit a3a7f52

Browse files
authored
Merge pull request microsoft#150264 from microsoft/joh/wide-wombat
joh/wide wombat
2 parents 3e83fa9 + 67c79ed commit a3a7f52

File tree

9 files changed

+53
-53
lines changed

9 files changed

+53
-53
lines changed

src/vs/platform/actions/common/actions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ export class MenuId {
6767
static readonly ExplorerContext = new MenuId('ExplorerContext');
6868
static readonly ExtensionContext = new MenuId('ExtensionContext');
6969
static readonly GlobalActivity = new MenuId('GlobalActivity');
70-
static readonly TitleMenu = new MenuId('TitleMenu');
70+
static readonly CommandCenter = new MenuId('CommandCenter');
7171
static readonly LayoutControlMenuSubmenu = new MenuId('LayoutControlMenuSubmenu');
7272
static readonly LayoutControlMenu = new MenuId('LayoutControlMenu');
7373
static readonly MenubarMainMenu = new MenuId('MenubarMainMenu');

src/vs/workbench/browser/actions/quickAccessActions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ registerAction2(class QuickAccessAction extends Action2 {
141141
},
142142
f1: true,
143143
menu: {
144-
id: MenuId.TitleMenu,
144+
id: MenuId.CommandCenter,
145145
order: 100
146146
}
147147
});

src/vs/workbench/browser/layout.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
148148
let quickPickTop = 0;
149149
if (this.isVisible(Parts.TITLEBAR_PART)) {
150150
top = this.getPart(Parts.TITLEBAR_PART).maximumHeight;
151-
quickPickTop = this.titleService.titleMenuVisible ? 0 : top;
151+
quickPickTop = this.titleService.isCommandCenterVisible ? 0 : top;
152152
}
153153
return { top, quickPickTop };
154154
}

src/vs/workbench/browser/parts/editor/editor.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -314,8 +314,8 @@ if (isMacintosh) {
314314
});
315315
}
316316

317-
MenuRegistry.appendMenuItem(MenuId.TitleMenu, { order: 1, command: { id: NavigateBackwardsAction.ID, title: NavigateBackwardsAction.LABEL, icon: Codicon.arrowLeft } });
318-
MenuRegistry.appendMenuItem(MenuId.TitleMenu, { order: 2, command: { id: NavigateForwardAction.ID, title: NavigateForwardAction.LABEL, icon: Codicon.arrowRight } });
317+
MenuRegistry.appendMenuItem(MenuId.CommandCenter, { order: 1, command: { id: NavigateBackwardsAction.ID, title: NavigateBackwardsAction.LABEL, icon: Codicon.arrowLeft } });
318+
MenuRegistry.appendMenuItem(MenuId.CommandCenter, { order: 2, command: { id: NavigateForwardAction.ID, title: NavigateForwardAction.LABEL, icon: Codicon.arrowRight } });
319319

320320
// Empty Editor Group Toolbar
321321
MenuRegistry.appendMenuItem(MenuId.EmptyEditorGroup, { command: { id: UNLOCK_GROUP_COMMAND_ID, title: localize('unlockGroupAction', "Unlock Group"), icon: Codicon.lock }, group: 'navigation', order: 10, when: ActiveEditorGroupLockedContext });

src/vs/workbench/browser/parts/titlebar/titleMenuControl.ts renamed to src/vs/workbench/browser/parts/titlebar/commandCenterControl.ts

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { WindowTitle } from 'vs/workbench/browser/parts/titlebar/windowTitle';
2727
import { MENUBAR_SELECTION_BACKGROUND, MENUBAR_SELECTION_FOREGROUND, TITLE_BAR_ACTIVE_FOREGROUND } from 'vs/workbench/common/theme';
2828
import { IHoverService } from 'vs/workbench/services/hover/browser/hover';
2929

30-
export class TitleMenuControl {
30+
export class CommandCenterControl {
3131

3232
private readonly _disposables = new DisposableStore();
3333

@@ -47,7 +47,7 @@ export class TitleMenuControl {
4747
@IConfigurationService configurationService: IConfigurationService,
4848
@IKeybindingService keybindingService: IKeybindingService,
4949
) {
50-
this.element.classList.add('title-menu');
50+
this.element.classList.add('command-center');
5151

5252
const hoverDelegate = new class implements IHoverDelegate {
5353

@@ -134,16 +134,16 @@ export class TitleMenuControl {
134134
return createActionViewItem(instantiationService, action, { hoverDelegate });
135135
}
136136
});
137-
const titleMenu = this._disposables.add(menuService.createMenu(MenuId.TitleMenu, contextKeyService));
138-
const titleMenuDisposables = this._disposables.add(new DisposableStore());
139-
const updateTitleMenu = () => {
140-
titleMenuDisposables.clear();
137+
const menu = this._disposables.add(menuService.createMenu(MenuId.CommandCenter, contextKeyService));
138+
const menuDisposables = this._disposables.add(new DisposableStore());
139+
const menuUpdater = () => {
140+
menuDisposables.clear();
141141
const actions: IAction[] = [];
142-
titleMenuDisposables.add(createAndFillInContextMenuActions(titleMenu, undefined, actions));
142+
menuDisposables.add(createAndFillInContextMenuActions(menu, undefined, actions));
143143
titleToolbar.setActions(actions);
144144
};
145-
updateTitleMenu();
146-
this._disposables.add(titleMenu.onDidChange(updateTitleMenu));
145+
menuUpdater();
146+
this._disposables.add(menu.onDidChange(menuUpdater));
147147
this._disposables.add(quickInputService.onShow(this._setVisibility.bind(this, false)));
148148
this._disposables.add(quickInputService.onHide(this._setVisibility.bind(this, true)));
149149
}
@@ -162,34 +162,34 @@ export class TitleMenuControl {
162162

163163
// foreground (inactive and active)
164164
colors.registerColor(
165-
'titleMenu.foreground',
165+
'commandCenter.foreground',
166166
{ dark: TITLE_BAR_ACTIVE_FOREGROUND, hcDark: TITLE_BAR_ACTIVE_FOREGROUND, light: TITLE_BAR_ACTIVE_FOREGROUND, hcLight: TITLE_BAR_ACTIVE_FOREGROUND },
167-
localize('titleMenu-foreground', "Foreground color of the title menu"),
167+
localize('commandCenter-foreground', "Foreground color of the command center"),
168168
false
169169
);
170170
colors.registerColor(
171-
'titleMenu.activeForeground',
171+
'commandCenter.activeForeground',
172172
{ dark: MENUBAR_SELECTION_FOREGROUND, hcDark: MENUBAR_SELECTION_FOREGROUND, light: MENUBAR_SELECTION_FOREGROUND, hcLight: MENUBAR_SELECTION_FOREGROUND },
173-
localize('titleMenu-activeForeground', "Active foreground color of the title menu"),
173+
localize('commandCenter-activeForeground', "Active foreground color of the command center"),
174174
false
175175
);
176176
// background (inactive and active)
177177
colors.registerColor(
178-
'titleMenu.background',
178+
'commandCenter.background',
179179
{ dark: null, hcDark: null, light: null, hcLight: null },
180-
localize('titleMenu-background', "Background color of the title menu"),
180+
localize('commandCenter-background', "Background color of the command center"),
181181
false
182182
);
183183
const activeBackground = colors.registerColor(
184-
'titleMenu.activeBackground',
184+
'commandCenter.activeBackground',
185185
{ dark: MENUBAR_SELECTION_BACKGROUND, hcDark: MENUBAR_SELECTION_BACKGROUND, light: MENUBAR_SELECTION_BACKGROUND, hcLight: MENUBAR_SELECTION_BACKGROUND },
186-
localize('titleMenu-activeBackground', "Active background color of the title menu"),
186+
localize('commandCenter-activeBackground', "Active background color of the command center"),
187187
false
188188
);
189189
// border: defaults to active background
190190
colors.registerColor(
191-
'titleMenu.border',
191+
'commandCenter.border',
192192
{ dark: activeBackground, hcDark: colors.inputBorder, light: activeBackground, hcLight: colors.inputBorder },
193-
localize('titleMenu-border', "Border color of the title menu"),
193+
localize('commandCenter-border', "Border color of the command center"),
194194
false
195195
);

src/vs/workbench/browser/parts/titlebar/media/titlebarpart.css

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -80,21 +80,21 @@
8080
}
8181

8282
/* Window Title Menu */
83-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu {
83+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center {
8484
z-index: 2550;
8585
-webkit-app-region: no-drag;
8686
padding: 0 8px;
8787
}
8888

89-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu.hide {
89+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center.hide {
9090
display: none;
9191
}
9292

93-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen {
93+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen {
9494
display: flex;
95-
color: var(--vscode-titleMenu-foreground);
96-
background-color: var(--vscode-titleMenu-background);
97-
border: 1px solid var(--vscode-titleMenu-border);
95+
color: var(--vscode-commandCenter-foreground);
96+
background-color: var(--vscode-commandCenter-background);
97+
border: 1px solid var(--vscode-commandCenter-border);
9898
border-radius: 5px;
9999
height: 20px;
100100
line-height: 18px;
@@ -106,18 +106,18 @@
106106
overflow: hidden;
107107
}
108108

109-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen:HOVER {
110-
color: var(--vscode-titleMenu-activeForeground);
111-
background-color: var(--vscode-titleMenu-activeBackground);
109+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen:HOVER {
110+
color: var(--vscode-commandCenter-activeForeground);
111+
background-color: var(--vscode-commandCenter-activeBackground);
112112
line-height: 18px;
113113
}
114114

115-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu:HOVER .quickopen .action-label {
115+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center:HOVER .quickopen .action-label {
116116
background-color: transparent !important;
117117
outline-color: transparent !important;
118118
}
119119

120-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen>.action-label.search {
120+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen>.action-label.search {
121121
display: inline-flex;
122122
text-align: center;
123123
font-size: 12px;
@@ -127,18 +127,18 @@
127127
width: calc(100% - 19px);
128128
}
129129

130-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen>.action-label.search>.search-icon {
130+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen>.action-label.search>.search-icon {
131131
font-size: 14px;
132132
opacity: .8;
133133
padding: 0 3px;
134134
}
135135

136-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen>.action-label.search>.search-label {
136+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen>.action-label.search>.search-label {
137137
overflow: hidden;
138138
text-overflow: ellipsis;
139139
}
140140

141-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu .action-item.quickopen>.all-options>.action-label {
141+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center .action-item.quickopen>.all-options>.action-label {
142142
text-align: center;
143143
font-size: 12px;
144144
width: 16px;
@@ -147,8 +147,8 @@
147147
padding-right: 0;
148148
}
149149

150-
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.title-menu:HOVER .action-item.quickopen>.all-options>.action-label {
151-
border-color: var(--vscode-titleMenu-border);
150+
.monaco-workbench .part.titlebar>.titlebar-container>.window-title>.command-center:HOVER .action-item.quickopen>.all-options>.action-label {
151+
border-color: var(--vscode-commandCenter-border);
152152
}
153153

154154
/* Menubar */

src/vs/workbench/browser/parts/titlebar/titlebarPart.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ import { Codicon } from 'vs/base/common/codicons';
3333
import { getIconRegistry } from 'vs/platform/theme/common/iconRegistry';
3434
import { ToolBar } from 'vs/base/browser/ui/toolbar/toolbar';
3535
import { WindowTitle } from 'vs/workbench/browser/parts/titlebar/windowTitle';
36-
import { TitleMenuControl } from 'vs/workbench/browser/parts/titlebar/titleMenuControl';
36+
import { CommandCenterControl } from 'vs/workbench/browser/parts/titlebar/commandCenterControl';
3737

3838
export class TitlebarPart extends Part implements ITitleService {
3939

40-
private static readonly configTitleMenu = 'window.experimental.titleMenu';
40+
private static readonly configCommandCenter = 'window.experimental.commandCenter';
4141

4242
declare readonly _serviceBrand: undefined;
4343

@@ -102,8 +102,8 @@ export class TitlebarPart extends Part implements ITitleService {
102102
this.windowTitle.updateProperties(properties);
103103
}
104104

105-
get titleMenuVisible() {
106-
return this.configurationService.getValue<boolean>(TitlebarPart.configTitleMenu);
105+
get isCommandCenterVisible() {
106+
return this.configurationService.getValue<boolean>(TitlebarPart.configCommandCenter);
107107
}
108108

109109
private registerListeners(): void {
@@ -137,7 +137,7 @@ export class TitlebarPart extends Part implements ITitleService {
137137
this.layoutControls.classList.toggle('show-layout-control', this.layoutControlEnabled);
138138
}
139139

140-
if (event.affectsConfiguration(TitlebarPart.configTitleMenu)) {
140+
if (event.affectsConfiguration(TitlebarPart.configCommandCenter)) {
141141
this.updateTitle();
142142
this.adjustTitleMarginToCenter();
143143
this._onDidChangeTitleMenuVisibility.fire();
@@ -183,7 +183,7 @@ export class TitlebarPart extends Part implements ITitleService {
183183

184184
private updateTitle(): void {
185185
this.titleDisposables.clear();
186-
if (!this.titleMenuVisible) {
186+
if (!this.isCommandCenterVisible) {
187187
// Text Title
188188
this.title.innerText = this.windowTitle.value;
189189
this.titleDisposables.add(this.windowTitle.onDidChange(() => {
@@ -192,10 +192,10 @@ export class TitlebarPart extends Part implements ITitleService {
192192
}));
193193
} else {
194194
// Menu Title
195-
const titleMenu = this.instantiationService.createInstance(TitleMenuControl, this.windowTitle);
196-
reset(this.title, titleMenu.element);
197-
this.titleDisposables.add(titleMenu);
198-
this.titleDisposables.add(titleMenu.onDidChangeVisibility(this.adjustTitleMarginToCenter, this));
195+
const commandCenter = this.instantiationService.createInstance(CommandCenterControl, this.windowTitle);
196+
reset(this.title, commandCenter.element);
197+
this.titleDisposables.add(commandCenter);
198+
this.titleDisposables.add(commandCenter.onDidChangeVisibility(this.adjustTitleMarginToCenter, this));
199199
}
200200
}
201201

src/vs/workbench/browser/workbench.contribution.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,10 +538,10 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
538538
'default': isMacintosh ? ' \u2014 ' : ' - ',
539539
'markdownDescription': localize("window.titleSeparator", "Separator used by `window.title`.")
540540
},
541-
'window.experimental.titleMenu': {
541+
'window.experimental.commandCenter': {
542542
type: 'boolean',
543543
default: false,
544-
description: localize('window.experimental.titleMenu', "Show window title as menu")
544+
markdownDescription: localize('window.experimental.commandCenter', "Show command launcher together with the window title. This setting only has an effect when `#window.titleBarStyle#` is set to `custom`.")
545545
},
546546
'window.menuBarVisibility': {
547547
'type': 'string',

src/vs/workbench/services/title/common/titleService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface ITitleService {
2626
/**
2727
* Title menu is visible
2828
*/
29-
readonly titleMenuVisible: boolean;
29+
readonly isCommandCenterVisible: boolean;
3030

3131
/**
3232
* An event when the title menu is enabled/disabled

0 commit comments

Comments
 (0)