提交 9433b67e 编写于 作者: J Joao Moreno

fixes #54031

上级 fb1e27fa
......@@ -93,7 +93,7 @@ import { NotificationService } from 'vs/workbench/services/notification/common/n
import { IDialogService } from 'vs/platform/dialogs/common/dialogs';
import { DialogService } from 'vs/workbench/services/dialogs/electron-browser/dialogService';
import { DialogChannel } from 'vs/platform/dialogs/common/dialogIpc';
import { EventType, addDisposableListener, addClass, getClientArea } from 'vs/base/browser/dom';
import { EventType, addDisposableListener, addClass } from 'vs/base/browser/dom';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { OpenerService } from 'vs/editor/browser/services/openerService';
import { SearchHistoryService } from 'vs/workbench/services/search/node/searchHistoryService';
......@@ -135,8 +135,6 @@ export class WorkbenchShell extends Disposable {
private container: HTMLElement;
private previousErrorValue: string;
private previousErrorTime: number;
private content: HTMLElement;
private contentsContainer: HTMLElement;
private configuration: IWindowConfiguration;
private workbench: Workbench;
......@@ -160,20 +158,15 @@ export class WorkbenchShell extends Disposable {
this.previousErrorTime = 0;
}
private createContents(parent: HTMLElement): HTMLElement {
private renderContents(): void {
// ARIA
aria.setARIAContainer(document.body);
// Workbench Container
const workbenchContainer = document.createElement('div');
parent.appendChild(workbenchContainer);
// Instantiation service with services
const [instantiationService, serviceCollection] = this.initServiceCollection(parent);
const [instantiationService, serviceCollection] = this.initServiceCollection(this.container);
// Workbench
this.workbench = this.createWorkbench(instantiationService, serviceCollection, parent, workbenchContainer);
this.workbench = this.createWorkbench(instantiationService, serviceCollection, this.container);
// Window
this.workbench.getInstantiationService().createInstance(ElectronWindow);
......@@ -186,13 +179,11 @@ export class WorkbenchShell extends Disposable {
this.lifecycleService.when(LifecyclePhase.Running).then(() => {
clearTimeout(timeoutHandle);
});
return workbenchContainer;
}
private createWorkbench(instantiationService: IInstantiationService, serviceCollection: ServiceCollection, parent: HTMLElement, workbenchContainer: HTMLElement): Workbench {
private createWorkbench(instantiationService: IInstantiationService, serviceCollection: ServiceCollection, container: HTMLElement): Workbench {
try {
const workbench = instantiationService.createInstance(Workbench, parent, workbenchContainer, this.configuration, serviceCollection, this.lifecycleService, this.mainProcessClient);
const workbench = instantiationService.createInstance(Workbench, container, this.configuration, serviceCollection, this.lifecycleService, this.mainProcessClient);
// Set lifecycle phase to `Restoring`
this.lifecycleService.phase = LifecyclePhase.Restoring;
......@@ -472,13 +463,8 @@ export class WorkbenchShell extends Disposable {
// Shell Class for CSS Scoping
addClass(this.container, 'monaco-shell');
// Controls
this.content = document.createElement('div');
addClass(this.content, 'monaco-shell-content');
this.container.appendChild(this.content);
// Create Contents
this.contentsContainer = this.createContents(this.content);
this.renderContents();
// Layout
this.layout();
......@@ -521,11 +507,6 @@ export class WorkbenchShell extends Disposable {
}
private layout(): void {
const clientArea = getClientArea(this.container);
this.contentsContainer.style.width = `${clientArea.width}px`;
this.contentsContainer.style.height = `${clientArea.height}px`;
this.contextViewService.layout();
this.workbench.layout();
}
......
......@@ -235,7 +235,6 @@ export class Workbench extends Disposable implements IPartService {
private closeEmptyWindowScheduler: RunOnceScheduler = this._register(new RunOnceScheduler(() => this.onAllEditorsClosed(), 50));
constructor(
private parent: HTMLElement,
private container: HTMLElement,
private configuration: IWindowConfiguration,
serviceCollection: ServiceCollection,
......@@ -973,12 +972,6 @@ export class Workbench extends Disposable implements IPartService {
// Apply font aliasing
this.setFontAliasing(this.fontAliasing);
// Apply title style if shown
const titleStyle = this.getCustomTitleBarStyle();
if (titleStyle) {
DOM.addClass(this.parent, `titlebar-style-${titleStyle}`);
}
// Apply fullscreen state
if (browser.isFullscreen()) {
this.workbench.addClass('fullscreen');
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册