Path: blob/main/src/vs/sessions/browser/parts/mobile/mobileAuxiliaryBarPart.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 { Parts } from '../../../../workbench/services/layout/browser/layoutService.js';6import { AbstractPaneCompositePart } from '../../../../workbench/browser/parts/paneCompositePart.js';7import { AuxiliaryBarPart } from '../auxiliaryBarPart.js';8import { isPhoneLayout } from './mobileLayout.js';910/**11* Mobile variant of AuxiliaryBarPart.12*13* On phone-sized viewports the auxiliary bar fills the full grid cell14* without card margins or border insets. On tablet/desktop it falls15* back to the desktop behavior so runtime viewport transitions keep16* working.17*/18export class MobileAuxiliaryBarPart extends AuxiliaryBarPart {1920override updateStyles(): void {21// Always run the desktop implementation first so inline card styles22// are set on tablet/desktop transitions. In phone mode we then23// clear them so CSS can take over (inline styles have the highest24// specificity).25super.updateStyles();2627if (!isPhoneLayout(this.layoutService)) {28return;29}3031const container = this.getContainer();32if (container) {33container.style.backgroundColor = '';34container.style.removeProperty('--part-background');35container.style.removeProperty('--part-border-color');36}37}3839override layout(width: number, height: number, top: number, left: number): void {40if (!isPhoneLayout(this.layoutService)) {41super.layout(width, height, top, left);42return;43}4445if (!this.layoutService.isVisible(Parts.AUXILIARYBAR_PART)) {46return;47}4849// Full dimensions — no card margins or border subtraction.50// AbstractPaneCompositePart.layout internally calls Part.layout.51AbstractPaneCompositePart.prototype.layout.call(this, width, height, top, left);52}53}545556