Skip to content

Commit 860f38b

Browse files
authored
aux window renames (microsoft#203775)
1 parent 74ef67b commit 860f38b

File tree

6 files changed

+24
-24
lines changed

6 files changed

+24
-24
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/b
2222
import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions';
2323
import { TogglePanelAction } from 'vs/workbench/browser/parts/panel/panelActions';
2424
import { ICommandService } from 'vs/platform/commands/common/commands';
25-
import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelVisibleContext, SideBarVisibleContext, FocusedViewContext, InEditorZenModeContext, IsCenteredLayoutContext, MainEditorAreaVisibleContext, IsMainWindowFullscreenContext, PanelPositionContext, IsAuxiliaryWindowFocusedContext, TitleBarStyleContext } from 'vs/workbench/common/contextkeys';
25+
import { AuxiliaryBarVisibleContext, PanelAlignmentContext, PanelVisibleContext, SideBarVisibleContext, FocusedViewContext, InEditorZenModeContext, IsMainEditorCenteredLayoutContext, MainEditorAreaVisibleContext, IsMainWindowFullscreenContext, PanelPositionContext, IsAuxiliaryWindowFocusedContext, TitleBarStyleContext } from 'vs/workbench/common/contextkeys';
2626
import { Codicon } from 'vs/base/common/codicons';
2727
import { ThemeIcon } from 'vs/base/common/themables';
2828
import { DisposableStore } from 'vs/base/common/lifecycle';
@@ -88,7 +88,7 @@ registerAction2(class extends Action2 {
8888
precondition: IsAuxiliaryWindowFocusedContext.toNegated(),
8989
category: Categories.View,
9090
f1: true,
91-
toggled: IsCenteredLayoutContext,
91+
toggled: IsMainEditorCenteredLayoutContext,
9292
menu: [{
9393
id: MenuId.MenubarAppearanceMenu,
9494
group: '1_toggle_view',
@@ -1388,7 +1388,7 @@ const AlignPanelActions: CustomizeLayoutItem[] = [
13881388
const MiscLayoutOptions: CustomizeLayoutItem[] = [
13891389
CreateOptionLayoutItem('workbench.action.toggleFullScreen', IsMainWindowFullscreenContext, localize('fullscreen', "Full Screen"), fullscreenIcon),
13901390
CreateOptionLayoutItem('workbench.action.toggleZenMode', InEditorZenModeContext, localize('zenMode', "Zen Mode"), zenModeIcon),
1391-
CreateOptionLayoutItem('workbench.action.toggleCenteredLayout', IsCenteredLayoutContext, localize('centeredLayout', "Centered Layout"), centerLayoutIcon),
1391+
CreateOptionLayoutItem('workbench.action.toggleCenteredLayout', IsMainEditorCenteredLayoutContext, localize('centeredLayout', "Centered Layout"), centerLayoutIcon),
13921392
];
13931393

13941394
const LayoutContextKeySet = new Set<string>();

src/vs/workbench/browser/contextkeys.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Event } from 'vs/base/common/event';
77
import { Disposable } from 'vs/base/common/lifecycle';
88
import { IContextKeyService, IContextKey, setConstant as setConstantContextKey } from 'vs/platform/contextkey/common/contextkey';
99
import { InputFocusedContext, IsMacContext, IsLinuxContext, IsWindowsContext, IsWebContext, IsMacNativeContext, IsDevelopmentContext, IsIOSContext, ProductQualityContext, IsMobileContext } from 'vs/platform/contextkey/common/contextkeys';
10-
import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext } from 'vs/workbench/common/contextkeys';
10+
import { SplitEditorsVertically, InEditorZenModeContext, ActiveEditorCanRevertContext, ActiveEditorGroupLockedContext, ActiveEditorCanSplitInGroupContext, SideBySideEditorActiveContext, AuxiliaryBarVisibleContext, SideBarVisibleContext, PanelAlignmentContext, PanelMaximizedContext, PanelVisibleContext, ActiveEditorContext, EditorsVisibleContext, TextCompareEditorVisibleContext, TextCompareEditorActiveContext, ActiveEditorGroupEmptyContext, EmbedderIdentifierContext, EditorTabsVisibleContext, IsMainEditorCenteredLayoutContext, ActiveEditorGroupIndexContext, ActiveEditorGroupLastContext, ActiveEditorReadonlyContext, MainEditorAreaVisibleContext, ActiveEditorAvailableEditorIdsContext, DirtyWorkingCopiesContext, EmptyWorkspaceSupportContext, EnterMultiRootWorkspaceSupportContext, HasWebFileSystemAccess, IsMainWindowFullscreenContext, OpenFolderWorkspaceSupportContext, RemoteNameContext, VirtualWorkspaceContext, WorkbenchStateContext, WorkspaceFolderCountContext, PanelPositionContext, TemporaryWorkspaceContext, ActiveEditorCanToggleReadonlyContext, applyAvailableEditorIds, TitleBarVisibleContext, TitleBarStyleContext, MultipleEditorGroupsContext, IsAuxiliaryWindowFocusedContext, ActiveCompareEditorOriginalWriteableContext } from 'vs/workbench/common/contextkeys';
1111
import { TEXT_DIFF_EDITOR_ID, EditorInputCapabilities, SIDE_BY_SIDE_EDITOR_ID, EditorResourceAccessor, SideBySideEditor } from 'vs/workbench/common/editor';
1212
import { trackFocus, addDisposableListener, EventType, onDidRegisterWindow, getActiveWindow } from 'vs/base/browser/dom';
1313
import { preferredSideBySideGroupDirection, GroupDirection, IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService';
@@ -71,7 +71,7 @@ export class WorkbenchContextKeysHandler extends Disposable {
7171
private inZenModeContext: IContextKey<boolean>;
7272
private isMainWindowFullscreenContext: IContextKey<boolean>;
7373
private isAuxiliaryWindowFocusedContext: IContextKey<boolean>;
74-
private isCenteredLayoutContext: IContextKey<boolean>;
74+
private isMainEditorCenteredLayoutContext: IContextKey<boolean>;
7575
private sideBarVisibleContext: IContextKey<boolean>;
7676
private mainEditorAreaVisibleContext: IContextKey<boolean>;
7777
private panelPositionContext: IContextKey<string>;
@@ -195,8 +195,8 @@ export class WorkbenchContextKeysHandler extends Disposable {
195195
// Zen Mode
196196
this.inZenModeContext = InEditorZenModeContext.bindTo(this.contextKeyService);
197197

198-
// Centered Layout
199-
this.isCenteredLayoutContext = IsCenteredLayoutContext.bindTo(this.contextKeyService);
198+
// Centered Layout (Main Editor)
199+
this.isMainEditorCenteredLayoutContext = IsMainEditorCenteredLayoutContext.bindTo(this.contextKeyService);
200200

201201
// Editor Area
202202
this.mainEditorAreaVisibleContext = MainEditorAreaVisibleContext.bindTo(this.contextKeyService);
@@ -266,7 +266,7 @@ export class WorkbenchContextKeysHandler extends Disposable {
266266
this.isMainWindowFullscreenContext.set(isFullscreen(mainWindow));
267267
}
268268
}));
269-
this._register(this.layoutService.onDidChangeCenteredLayout(centered => this.isCenteredLayoutContext.set(centered)));
269+
this._register(this.layoutService.onDidChangeMainEditorCenteredLayout(centered => this.isMainEditorCenteredLayoutContext.set(centered)));
270270
this._register(this.layoutService.onDidChangePanelPosition(position => this.panelPositionContext.set(position)));
271271

272272
this._register(this.layoutService.onDidChangePanelAlignment(alignment => this.panelAlignmentContext.set(alignment)));

src/vs/workbench/browser/layout.ts

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -126,8 +126,8 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
126126
private readonly _onDidChangeZenMode = this._register(new Emitter<boolean>());
127127
readonly onDidChangeZenMode = this._onDidChangeZenMode.event;
128128

129-
private readonly _onDidChangeCenteredLayout = this._register(new Emitter<boolean>());
130-
readonly onDidChangeCenteredLayout = this._onDidChangeCenteredLayout.event;
129+
private readonly _onDidChangeMainEditorCenteredLayout = this._register(new Emitter<boolean>());
130+
readonly onDidChangeMainEditorCenteredLayout = this._onDidChangeMainEditorCenteredLayout.event;
131131

132132
private readonly _onDidChangePanelAlignment = this._register(new Emitter<PanelAlignment>());
133133
readonly onDidChangePanelAlignment = this._onDidChangePanelAlignment.event;
@@ -338,7 +338,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
338338
this._register(this.editorGroupService.mainPart.onDidActivateGroup(showEditorIfHidden));
339339

340340
// Revalidate center layout when active editor changes: diff editor quits centered mode.
341-
this._register(this.mainPartEditorService.onDidActiveEditorChange(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
341+
this._register(this.mainPartEditorService.onDidActiveEditorChange(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
342342
});
343343

344344
// Configuration changes
@@ -371,9 +371,9 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
371371
this._register(onDidChangeFullscreen(windowId => this.onFullscreenChanged(windowId)));
372372

373373
// Group changes
374-
this._register(this.editorGroupService.mainPart.onDidAddGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
375-
this._register(this.editorGroupService.mainPart.onDidRemoveGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
376-
this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED))));
374+
this._register(this.editorGroupService.mainPart.onDidAddGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
375+
this._register(this.editorGroupService.mainPart.onDidRemoveGroup(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
376+
this._register(this.editorGroupService.mainPart.onDidChangeGroupMaximized(() => this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED))));
377377

378378
// Prevent workbench from scrolling #55456
379379
this._register(addDisposableListener(this.mainContainer, EventType.SCROLL, () => this.mainContainer.scrollTop = 0));
@@ -511,7 +511,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
511511

512512
// Centered Layout
513513
this.editorGroupService.whenRestored.then(() => {
514-
this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED), skipLayout);
514+
this.centerMainEditorLayout(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED), skipLayout);
515515
});
516516
}
517517

@@ -1069,7 +1069,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
10691069
}
10701070

10711071
// Restore Main Editor Center Mode
1072-
if (this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED)) {
1072+
if (this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED)) {
10731073
this.centerMainEditorLayout(true, true);
10741074
}
10751075

@@ -1631,11 +1631,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
16311631
}
16321632

16331633
isMainEditorLayoutCentered(): boolean {
1634-
return this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED);
1634+
return this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED);
16351635
}
16361636

16371637
centerMainEditorLayout(active: boolean, skipLayout?: boolean): void {
1638-
this.stateModel.setRuntimeValue(LayoutStateKeys.EDITOR_CENTERED, active);
1638+
this.stateModel.setRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED, active);
16391639

16401640
const activeMainEditor = this.mainPartEditorService.activeEditor;
16411641

@@ -1662,7 +1662,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
16621662
}
16631663
}
16641664

1665-
this._onDidChangeCenteredLayout.fire(this.stateModel.getRuntimeValue(LayoutStateKeys.EDITOR_CENTERED));
1665+
this._onDidChangeMainEditorCenteredLayout.fire(this.stateModel.getRuntimeValue(LayoutStateKeys.MAIN_EDITOR_CENTERED));
16661666
}
16671667

16681668
resizePart(part: Parts, sizeChangeWidth: number, sizeChangeHeight: number): void {
@@ -2550,7 +2550,7 @@ class InitializationStateKey<T extends StorageKeyType> extends WorkbenchLayoutSt
25502550
const LayoutStateKeys = {
25512551

25522552
// Editor
2553-
EDITOR_CENTERED: new RuntimeStateKey<boolean>('editor.centered', StorageScope.WORKSPACE, StorageTarget.MACHINE, false),
2553+
MAIN_EDITOR_CENTERED: new RuntimeStateKey<boolean>('editor.centered', StorageScope.WORKSPACE, StorageTarget.MACHINE, false),
25542554

25552555
// Zen Mode
25562556
ZEN_MODE_ACTIVE: new RuntimeStateKey<boolean>('zenMode.active', StorageScope.WORKSPACE, StorageTarget.MACHINE, false),

src/vs/workbench/common/contextkeys.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export const IsAuxiliaryEditorPartContext = new RawContextKey<boolean>('isAuxili
8282
// Editor Layout Context Keys
8383
export const EditorsVisibleContext = new RawContextKey<boolean>('editorIsOpen', false, localize('editorIsOpen', "Whether an editor is open"));
8484
export const InEditorZenModeContext = new RawContextKey<boolean>('inZenMode', false, localize('inZenMode', "Whether Zen mode is enabled"));
85-
export const IsCenteredLayoutContext = new RawContextKey<boolean>('isCenteredLayout', false, localize('isCenteredLayout', "Whether centered layout is enabled"));
85+
export const IsMainEditorCenteredLayoutContext = new RawContextKey<boolean>('isCenteredLayout', false, localize('isMainEditorCenteredLayout', "Whether centered layout is enabled for the main editor"));
8686
export const SplitEditorsVertically = new RawContextKey<boolean>('splitEditorsVertically', false, localize('splitEditorsVertically', "Whether editors split vertically"));
8787
export const MainEditorAreaVisibleContext = new RawContextKey<boolean>('mainEditorAreaVisible', true, localize('mainEditorAreaVisible', "Whether the editor area in the main window is visible"));
8888
export const EditorTabsVisibleContext = new RawContextKey<boolean>('editorTabsVisible', true, localize('editorTabsVisible', "Whether editor tabs are visible"));

src/vs/workbench/services/layout/browser/layoutService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -130,9 +130,9 @@ export interface IWorkbenchLayoutService extends ILayoutService {
130130
readonly onDidChangeWindowMaximized: Event<{ readonly windowId: number; readonly maximized: boolean }>;
131131

132132
/**
133-
* Emits when centered layout is enabled or disabled.
133+
* Emits when main editor centered layout is enabled or disabled.
134134
*/
135-
readonly onDidChangeCenteredLayout: Event<boolean>;
135+
readonly onDidChangeMainEditorCenteredLayout: Event<boolean>;
136136

137137
/*
138138
* Emit when panel position changes.

src/vs/workbench/test/browser/workbenchTestServices.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ export class TestLayoutService implements IWorkbenchLayoutService {
605605
activeContainer: HTMLElement = mainWindow.document.body;
606606

607607
onDidChangeZenMode: Event<boolean> = Event.None;
608-
onDidChangeCenteredLayout: Event<boolean> = Event.None;
608+
onDidChangeMainEditorCenteredLayout: Event<boolean> = Event.None;
609609
onDidChangeWindowMaximized: Event<{ windowId: number; maximized: boolean }> = Event.None;
610610
onDidChangePanelPosition: Event<string> = Event.None;
611611
onDidChangePanelAlignment: Event<PanelAlignment> = Event.None;

0 commit comments

Comments
 (0)