activity bar on top

This commit is contained in:
Sandeep Somavarapu
2023-10-07 18:14:13 +02:00
parent ef9f5d7f6f
commit 3dea66b26d
21 changed files with 1153 additions and 1030 deletions

View File

@@ -7,10 +7,11 @@ import { Registry } from 'vs/platform/registry/common/platform';
import { localize } from 'vs/nls';
import { IConfigurationRegistry, Extensions as ConfigurationExtensions, ConfigurationScope } from 'vs/platform/configuration/common/configurationRegistry';
import { isMacintosh, isWindows, isLinux, isWeb, isNative } from 'vs/base/common/platform';
import { ConfigurationMigrationWorkbenchContribution, DynamicWorkbenchConfigurationWorkbenchContribution, workbenchConfigurationNodeBase } from 'vs/workbench/common/configuration';
import { ConfigurationMigrationWorkbenchContribution, DynamicWorkbenchConfigurationWorkbenchContribution, IConfigurationMigrationRegistry, workbenchConfigurationNodeBase, Extensions, ConfigurationKeyValuePairs } from 'vs/workbench/common/configuration';
import { isStandalone } from 'vs/base/browser/browser';
import { IWorkbenchContributionsRegistry, Extensions as WorkbenchExtensions } from 'vs/workbench/common/contributions';
import { LifecyclePhase } from 'vs/workbench/services/lifecycle/common/lifecycle';
import { ActivityBarPosition, LayoutSettings } from 'vs/workbench/services/layout/browser/layoutService';
const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Configuration);
@@ -462,10 +463,16 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'default': true,
'description': localize('statusBarVisibility', "Controls the visibility of the status bar at the bottom of the workbench.")
},
'workbench.activityBar.visible': {
'type': 'boolean',
'default': true,
'description': localize('activityBarVisibility', "Controls the visibility of the activity bar in the workbench.")
[LayoutSettings.ACTIVITY_BAR_LOCATION]: {
'type': 'string',
'enum': ['side', 'top', 'hidden'],
'default': 'side',
'markdownDescription': localize({ comment: ['This is the description for a setting'], key: 'activityBarLocation' }, "Controls the location of the activity bar. It can either show to the `side` or `top` of the primary side bar or `hidden`. When shown in the top, settings and user menu actions are shown in the title bar to the right (requires `{0}`).", '#window.commandCenter#'),
'enumDescriptions': [
localize('workbench.activityBar.location.side', "Show the activity bar to the side of the primary side bar."),
localize('workbench.activityBar.location.top', "Show the activity bar on top of the primary side bar. When in this mode, application settings and user menu are shown in the title bar to the right."),
localize('workbench.activityBar.location.hide', "Hide the activity bar.")
]
},
'workbench.activityBar.iconClickBehavior': {
'type': 'string',
@@ -747,3 +754,14 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
}
});
})();
Registry.as<IConfigurationMigrationRegistry>(Extensions.ConfigurationMigration)
.registerConfigurationMigrations([{
key: LayoutSettings.ACTIVITY_BAR_LOCATION, migrateFn: (value: any) => {
const result: ConfigurationKeyValuePairs = [['workbench.activityBar.visible', { value: undefined }]];
if (value === false) {
result.push([LayoutSettings.ACTIVITY_BAR_LOCATION, { value: ActivityBarPosition.HIDDEN }]);
}
return result;
}
}]);