Не подтверждена Коммит ba5d25aa создал по автору Benjamin Pasero's avatar Benjamin Pasero
Просмотр файлов

clanup

владелец a88e5e11
......@@ -248,6 +248,8 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
//#endregion
protected scopedContextKeyService: IContextKeyService;
protected rootContainer!: HTMLElement;
protected windowControlsContainer: HTMLElement | undefined;
......@@ -302,7 +304,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
@IThemeService themeService: IThemeService,
@IStorageService private readonly storageService: IStorageService,
@IWorkbenchLayoutService layoutService: IWorkbenchLayoutService,
@IContextKeyService protected contextKeyService: IContextKeyService,
@IContextKeyService contextKeyService: IContextKeyService,
@IHostService private readonly hostService: IHostService,
@IEditorGroupsService private readonly editorGroupService: IEditorGroupsService,
@IEditorService editorService: IEditorService,
......@@ -313,12 +315,12 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this.isAuxiliary = editorGroupsContainer !== 'main';
this.contextKeyService = contextKeyService.createScoped(layoutService.getContainer(targetWindow));
const isAuxiliaryTitleBarContext = IsAuxiliaryTitleBarContext.bindTo(this.contextKeyService);
this.scopedContextKeyService = contextKeyService.createScoped(layoutService.getContainer(targetWindow));
const isAuxiliaryTitleBarContext = IsAuxiliaryTitleBarContext.bindTo(this.scopedContextKeyService);
isAuxiliaryTitleBarContext.set(this.isAuxiliary);
this.titleBarStyle = getTitleBarStyle(this.configurationService);
this.globalToolbarMenu = this._register(this.menuService.createMenu(MenuId.TitleBar, this.contextKeyService));
this.globalToolbarMenu = this._register(this.menuService.createMenu(MenuId.TitleBar, this.scopedContextKeyService));
this.editorService = editorService.createScoped(editorGroupsContainer, this._store);
this.editorGroupsContainer = editorGroupsContainer === 'main' ? editorGroupService.mainPart : editorGroupsContainer;
......@@ -595,7 +597,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
}
private getKeybinding(action: IAction): ResolvedKeybinding | undefined {
const editorPaneAwareContextKeyService = this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService ?? this.contextKeyService;
const editorPaneAwareContextKeyService = this.editorGroupsContainer.activeGroup?.activeEditorPane?.scopedContextKeyService ?? this.scopedContextKeyService;
return this.keybindingService.lookupKeybinding(action.id, editorPaneAwareContextKeyService);
}
......@@ -699,7 +701,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this.layoutToolbarMenuDisposables.clear();
if (this.layoutControlEnabled) {
this.layoutToolbarMenu = this.menuService.createMenu(MenuId.LayoutControlMenu, this.contextKeyService);
this.layoutToolbarMenu = this.menuService.createMenu(MenuId.LayoutControlMenu, this.scopedContextKeyService);
this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu);
this.layoutToolbarMenuDisposables.add(this.layoutToolbarMenu.onDidChange(() => updateToolBarActions()));
......@@ -766,7 +768,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
this.contextMenuService.showContextMenu({
getAnchor: () => event,
menuId,
contextKeyService: this.contextKeyService,
contextKeyService: this.scopedContextKeyService,
domForShadowRoot: isMacintosh && isNative ? event.target : undefined
});
}
......
......@@ -428,10 +428,7 @@ export class ToggleWindowAlwaysOnTopAction extends Action2 {
constructor() {
super({
id: ToggleWindowAlwaysOnTopAction.ID,
title: {
...localize2('toggleWindowAlwaysOnTop', "Toggle Window Always On Top"),
mnemonicTitle: localize({ key: 'miToggleWindowAlwaysOnTop', comment: ['&& denotes a mnemonic'] }, "Tog&&gle Window Always On Top"),
},
title: localize('toggleWindowAlwaysOnTop', "Toggle Window Always on Top"),
icon: Codicon.pin,
toggled: { condition: IsWindowAlwaysOnTopContext, icon: Codicon.pinned },
menu: {
......@@ -450,6 +447,6 @@ export class ToggleWindowAlwaysOnTopAction extends Action2 {
return; // Currently, we only support toggling always on top for auxiliary windows
}
nativeHostService.toggleWindowAlwaysOnTop({ targetWindowId: getActiveWindow().vscodeWindowId });
return nativeHostService.toggleWindowAlwaysOnTop({ targetWindowId: getActiveWindow().vscodeWindowId });
}
}
......@@ -86,7 +86,7 @@ export class NativeTitlebarPart extends BrowserTitlebarPart {
}
private async handleWindowsAlwaysOnTop(targetWindowId: number): Promise<void> {
const isWindowAlwaysOnTopContext = IsWindowAlwaysOnTopContext.bindTo(this.contextKeyService);
const isWindowAlwaysOnTopContext = IsWindowAlwaysOnTopContext.bindTo(this.scopedContextKeyService);
this._register(this.nativeHostService.onDidChangeWindowAlwaysOnTop(({ windowId, alwaysOnTop }) => {
if (windowId === targetWindowId) {
......
Поддерживает Markdown
0% или .
You are about to add 0 people to the discussion. Proceed with caution.
Сначала завершите редактирование этого сообщения!
Пожалуйста, зарегистрируйтесь или чтобы прокомментировать