mirror of
https://github.com/microsoft/vscode.git
synced 2026-09-25 00:44:05 +01:00
remove side panel setting
This commit is contained in:
@@ -828,10 +828,10 @@ registerAction2(class extends Action2 {
|
||||
|
||||
constructor() {
|
||||
super({
|
||||
id: 'workbench.action.swapPanelViews',
|
||||
id: 'workbench.action.movePanelToSidePanel',
|
||||
title: {
|
||||
value: localize('swapPanelViews', "Swap Panel View Containers"),
|
||||
original: 'Swap Panel View Containers'
|
||||
value: localize('movePanelToSidePanel', "Move Panel To Side Panel"),
|
||||
original: 'Move Panel To Side Panel'
|
||||
},
|
||||
category: CATEGORIES.View,
|
||||
f1: true,
|
||||
|
||||
@@ -49,7 +49,7 @@ import { getVirtualWorkspaceScheme } from 'vs/platform/remote/common/remoteHosts
|
||||
import { Schemas } from 'vs/base/common/network';
|
||||
import { IPaneCompositePartService } from 'vs/workbench/services/panecomposite/browser/panecomposite';
|
||||
import { ActivitybarPart } from 'vs/workbench/browser/parts/activitybar/activitybarPart';
|
||||
import { AuxiliaryBarPart, AUXILIARYBAR_ENABLED } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart';
|
||||
import { AuxiliaryBarPart } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarPart';
|
||||
import { ITelemetryService } from 'vs/platform/telemetry/common/telemetry';
|
||||
import { LayoutStateKeys, LayoutStateModel, WorkbenchLayoutSettings } from 'vs/workbench/browser/layoutState';
|
||||
|
||||
@@ -500,7 +500,7 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
}
|
||||
|
||||
// Auxiliary Panel to restore
|
||||
if (this.configurationService.getValue(AUXILIARYBAR_ENABLED) && this.isVisible(Parts.AUXILIARYBAR_PART)) {
|
||||
if (this.isVisible(Parts.AUXILIARYBAR_PART)) {
|
||||
let viewContainerToRestore = this.storageService.get(AuxiliaryBarPart.activePanelSettingsKey, StorageScope.WORKSPACE, this.viewDescriptorService.getDefaultViewContainer(ViewContainerLocation.AuxiliaryBar)?.id);
|
||||
|
||||
if (viewContainerToRestore) {
|
||||
@@ -510,11 +510,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
}
|
||||
}
|
||||
|
||||
// Hide Auxiliary Bar if disabled
|
||||
if (!this.configurationService.getValue(AUXILIARYBAR_ENABLED)) {
|
||||
this.stateModel.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, true);
|
||||
}
|
||||
|
||||
// Window border
|
||||
this.updateWindowBorder(true);
|
||||
}
|
||||
@@ -1624,10 +1619,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
|
||||
}
|
||||
|
||||
private setAuxiliaryBarHidden(hidden: boolean, skipLayout?: boolean): void {
|
||||
if (!this.configurationService || !this.configurationService.getValue(AUXILIARYBAR_ENABLED)) {
|
||||
return;
|
||||
}
|
||||
|
||||
this.stateModel.setRuntimeValue(LayoutStateKeys.AUXILIARYBAR_HIDDEN, hidden);
|
||||
|
||||
// Adjust CSS
|
||||
|
||||
@@ -71,7 +71,6 @@ MenuRegistry.appendMenuItems([
|
||||
title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Si&&de Panel"),
|
||||
toggled: AuxiliaryBarVisibleContext
|
||||
},
|
||||
when: ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true),
|
||||
order: 4
|
||||
}
|
||||
},
|
||||
@@ -84,7 +83,6 @@ MenuRegistry.appendMenuItems([
|
||||
title: localize({ key: 'miShowAuxiliaryBar', comment: ['&& denotes a mnemonic'] }, "Show Si&&de Panel"),
|
||||
toggled: AuxiliaryBarVisibleContext
|
||||
},
|
||||
when: ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true),
|
||||
order: 5
|
||||
}
|
||||
}, {
|
||||
@@ -102,5 +100,5 @@ MenuRegistry.appendMenuItems([
|
||||
]);
|
||||
|
||||
const actionRegistry = Registry.as<IWorkbenchActionRegistry>(WorkbenchExtensions.WorkbenchActions);
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Side Panel', CATEGORIES.View.value, ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true));
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Side Panel', CATEGORIES.View.value, ContextKeyExpr.equals('config.workbench.experimental.sidePanel.enabled', true));
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(ToggleAuxiliaryBarAction), 'View: Toggle Side Panel', CATEGORIES.View.value);
|
||||
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.from(FocusAuxiliaryBarAction), 'View: Focus into Side Panel', CATEGORIES.View.value);
|
||||
|
||||
@@ -26,9 +26,6 @@ import { HoverPosition } from 'vs/base/browser/ui/hover/hoverWidget';
|
||||
import { IAction, Separator } from 'vs/base/common/actions';
|
||||
import { ToggleAuxiliaryBarAction } from 'vs/workbench/browser/parts/auxiliarybar/auxiliaryBarActions';
|
||||
import { assertIsDefined } from 'vs/base/common/types';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
export const AUXILIARYBAR_ENABLED: string = 'workbench.experimental.sidePanel.enabled';
|
||||
|
||||
export class AuxiliaryBarPart extends BasePanelPart {
|
||||
static readonly activePanelSettingsKey = 'workbench.auxiliarybar.activepanelid';
|
||||
@@ -36,13 +33,12 @@ export class AuxiliaryBarPart extends BasePanelPart {
|
||||
static readonly placeholdeViewContainersKey = 'workbench.auxiliarybar.placeholderPanels';
|
||||
|
||||
// Use the side bar dimensions
|
||||
override readonly minimumWidth: number = this.isEnabled ? 170 : 0;
|
||||
override readonly maximumWidth: number = this.isEnabled ? Number.POSITIVE_INFINITY : 0;
|
||||
override readonly minimumWidth: number = 170;
|
||||
override readonly maximumWidth: number = Number.POSITIVE_INFINITY;
|
||||
override readonly minimumHeight: number = 0;
|
||||
override readonly maximumHeight: number = Number.POSITIVE_INFINITY;
|
||||
|
||||
constructor(
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@INotificationService notificationService: INotificationService,
|
||||
@IStorageService storageService: IStorageService,
|
||||
@ITelemetryService telemetryService: ITelemetryService,
|
||||
@@ -84,10 +80,6 @@ export class AuxiliaryBarPart extends BasePanelPart {
|
||||
);
|
||||
}
|
||||
|
||||
get isEnabled(): boolean {
|
||||
return !!this.configurationService.getValue<boolean>(AUXILIARYBAR_ENABLED);
|
||||
}
|
||||
|
||||
override updateStyles(): void {
|
||||
super.updateStyles();
|
||||
|
||||
|
||||
@@ -362,12 +362,6 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
|
||||
'default': false,
|
||||
'description': localize('layoutControlEnabled', "Controls whether the layout control button in the custom title bar is enabled."),
|
||||
},
|
||||
'workbench.experimental.sidePanel.enabled': {
|
||||
'type': 'boolean',
|
||||
'default': false,
|
||||
'description': localize('auxiliaryBarEnabled', "Controls whether the side panel opposite the side bar is enabled."),
|
||||
'included': product.quality !== 'stable'
|
||||
},
|
||||
'workbench.experimental.panel.alignment': {
|
||||
'type': 'string',
|
||||
'enum': ['left', 'center', 'right', 'justify'],
|
||||
|
||||
@@ -19,7 +19,6 @@ import { IInstantiationService, ServicesAccessor } from 'vs/platform/instantiati
|
||||
import { getViewsStateStorageId, ViewContainerModel } from 'vs/workbench/services/views/common/viewContainerModel';
|
||||
import { registerAction2, Action2, MenuId } from 'vs/platform/actions/common/actions';
|
||||
import { localize } from 'vs/nls';
|
||||
import { IConfigurationService } from 'vs/platform/configuration/common/configuration';
|
||||
|
||||
interface ICachedViewContainerInfo {
|
||||
containerId: string;
|
||||
@@ -95,7 +94,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
|
||||
|
||||
constructor(
|
||||
@IInstantiationService private readonly instantiationService: IInstantiationService,
|
||||
@IConfigurationService private readonly configurationService: IConfigurationService,
|
||||
@IContextKeyService private readonly contextKeyService: IContextKeyService,
|
||||
@IStorageService private readonly storageService: IStorageService,
|
||||
@IExtensionService private readonly extensionService: IExtensionService,
|
||||
@@ -119,11 +117,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
|
||||
// Register all containers that were registered before this ctor
|
||||
this.viewContainers.forEach(viewContainer => this.onDidRegisterViewContainer(viewContainer));
|
||||
|
||||
// TODO@sbatten remove with setting for side panel/auxiliary bar
|
||||
if (!this.configurationService.getValue<boolean>('workbench.experimental.sidePanel.enabled')) {
|
||||
this.fallbackDisabledAuxiliaryBar();
|
||||
}
|
||||
|
||||
this._register(this.viewsRegistry.onViewsRegistered(views => this.onDidRegisterViews(views)));
|
||||
this._register(this.viewsRegistry.onViewsDeregistered(({ views, viewContainer }) => this.onDidDeregisterViews(views, viewContainer)));
|
||||
|
||||
@@ -191,35 +184,6 @@ export class ViewDescriptorService extends Disposable implements IViewDescriptor
|
||||
}
|
||||
}
|
||||
|
||||
private fallbackDisabledAuxiliaryBar(): void {
|
||||
for (const [containerId, containerLocation] of this.cachedViewContainerInfo.entries()) {
|
||||
if (containerLocation === ViewContainerLocation.AuxiliaryBar) {
|
||||
const container = this.getViewContainerById(containerId);
|
||||
if (!container || this.isGeneratedContainerId(containerId)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
this.moveViewContainerToLocation(container, this.getDefaultViewContainerLocation(container));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for (const [viewId, containerInfo] of this.cachedViewInfo.entries()) {
|
||||
const containerId = containerInfo.containerId;
|
||||
|
||||
if (!this.isGeneratedContainerId(containerId) || this.cachedViewContainerInfo.get(containerId) !== ViewContainerLocation.AuxiliaryBar) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if view has been registered to default location
|
||||
const viewContainer = this.viewsRegistry.getViewContainer(viewId);
|
||||
const viewDescriptor = this.getViewDescriptorById(viewId);
|
||||
if (viewContainer && viewDescriptor) {
|
||||
this.addViews(viewContainer, [viewDescriptor]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fallbackOrphanedViews(): void {
|
||||
for (const [viewId, containerInfo] of this.cachedViewInfo.entries()) {
|
||||
const containerId = containerInfo.containerId;
|
||||
|
||||
Reference in New Issue
Block a user