Path: blob/main/src/vs/sessions/browser/parts/mobile/mobileLayout.ts
13399 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 { IWorkbenchLayoutService } from '../../../../workbench/services/layout/browser/layoutService.js';67/**8* CSS class applied to the sessions workbench main container when the9* viewport is classified as phone. Must stay in sync with10* `LayoutClasses.PHONE_LAYOUT` in `workbench.ts`.11*/12const PHONE_LAYOUT_CLASS = 'phone-layout';1314/**15* Returns true when the sessions workbench currently has the phone16* layout class on its main container.17*18* Mobile Part subclasses are chosen once at construction time, but the19* viewport class can change at runtime (e.g., device rotation crossing20* the phone breakpoint). Parts use this to decide whether to apply21* mobile-specific layout math or defer to the desktop implementation.22*/23export function isPhoneLayout(layoutService: IWorkbenchLayoutService): boolean {24return layoutService.mainContainer.classList.contains(PHONE_LAYOUT_CLASS);25}262728