From 6e791623ae771986232bb023c1fb7997f03eade4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Mangeonjean?= Date: Mon, 8 Jan 2024 20:07:01 +0100 Subject: [PATCH] fix: implement empty method --- src/service-override/layout.ts | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/src/service-override/layout.ts b/src/service-override/layout.ts index 3feca027..f32c3dcc 100644 --- a/src/service-override/layout.ts +++ b/src/service-override/layout.ts @@ -20,6 +20,7 @@ import { IAuxiliaryWindowService } from 'vs/workbench/services/auxiliaryWindow/b import { StandaloneCodeEditor } from 'vs/editor/standalone/browser/standaloneCodeEditor' import { IHostService } from 'vs/workbench/services/host/browser/host' import { ICodeEditorService } from 'vs/editor/browser/services/codeEditorService' +import { getMenuBarVisibility, getTitleBarStyle } from 'vs/platform/window/common/window' import { onRenderWorkbench } from '../lifecycle' import { getWorkbenchContainer } from '../workbench' @@ -225,19 +226,20 @@ export class LayoutService extends Disposable implements ILayoutService, IWorkbe toggleMaximizedPanel (): void { } - hasWindowBorder (): boolean { - return false - } - - getWindowBorderWidth (): number { - return 0 - } + toggleMenuBar (): void { + let currentVisibilityValue = getMenuBarVisibility(this.configurationService) + if (typeof currentVisibilityValue !== 'string') { + currentVisibilityValue = 'classic' + } - getWindowBorderRadius (): string | undefined { - return undefined - } + let newVisibilityValue: string + if (currentVisibilityValue === 'visible' || currentVisibilityValue === 'classic') { + newVisibilityValue = getTitleBarStyle(this.configurationService) === 'native' ? 'toggle' : 'compact' + } else { + newVisibilityValue = 'classic' + } - toggleMenuBar (): void { + void this.configurationService.updateValue('window.menuBarVisibility', newVisibilityValue) } setPanelPosition (position: Position): void {