Path: blob/main/src/vs/sessions/browser/parts/editorPart.ts
13395 views
/*---------------------------------------------------------------------------------------------1* Copyright (c) Microsoft Corporation. All rights reserved.2* Licensed under the MIT License. See License.txt in the project root for license information.3*--------------------------------------------------------------------------------------------*/45import { mainWindow } from '../../../base/browser/window.js';6import { MainEditorPart as MainEditorPartBase } from '../../../workbench/browser/parts/editor/editorPart.js';7import { Parts } from '../../../workbench/services/layout/browser/layoutService.js';89export class MainEditorPart extends MainEditorPartBase {10static readonly MARGIN_TOP = 0;11static readonly MARGIN_LEFT = 10;12static readonly MARGIN_BOTTOM = 10;1314override layout(width: number, height: number, top: number, left: number): void {15if (!this.layoutService.isVisible(Parts.EDITOR_PART, mainWindow)) {16return;17}1819const adjustedMargin = this.layoutService.isVisible(Parts.SIDEBAR_PART) ||20this.layoutService.isVisible(Parts.CHATBAR_PART)21? 022: MainEditorPart.MARGIN_LEFT;23const adjustedWidth = width - adjustedMargin - 2 /* border width */;24const adjustedHeight = height - MainEditorPart.MARGIN_TOP - MainEditorPart.MARGIN_BOTTOM - 2 /* border width */;2526super.layout(adjustedWidth, adjustedHeight, top, left);27}28}293031